package action;

import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;
import java.sql.ResultSet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
import org.apache.struts.action.DynaActionForm;
import org.apache.struts.actions.DispatchAction;
import entitybean.oc_boat.EntityBeanOc_Boat;
import entitybean.oc_boat_ben.EntityBeanOc_Boat_Ben;
import entitybean.oc_boat_ice.EntityBeanOc_Boat_Ice;
import entitybean.oc_boat_pla.EntityBeanOc_Boat_Pla;
import entitybean.oc_date_ben.EnitityBeanOc_Date_Ben;
import entitybean.oc_date_pla.EnitityBeanOc_Date_Pla;
import entitybean.oc_date_ice.EnitityBeanOc_Date_Ice;
import entitybean.oc_date_sur.EnitityBeanOc_Date_Sur;
import entitybean.oc_depthlist.EntityBeanOc_Depthlist;
import entitybean.oc_depthlist_ben.EntityBeanOc_Depthlist_Ben;
import entitybean.oc_depthlist_ice.EntityBeanOc_Depthlist_Ice;
import entitybean.oc_depthlist_pla.EntityBeanOc_Depthlist_Pla;
import entitybean.oc_property.EntityBean_Oc_Property;
import entitybean.oc_property_ben.EntityBean_Oc_Property_Ben;
import entitybean.oc_property_ice.EntityBean_Oc_Property_Ice;
import entitybean.oc_property_pla.EntityBean_Oc_Property_Pla;
import entitybean.oc_property_tools.EntityBean_Oc_Property_Tools;
import entitybean.oc_property_tools_ben.EntityBean_Oc_Property_Tools_Ben;
import entitybean.oc_property_tools_ice.EntityBean_Oc_Property_Tools_Ice;
import entitybean.oc_property_tools_pla.EntityBean_Oc_Property_Tools_Pla;
import entitybean.oc_sea_area.EntityBeanOc_Sea_Area;
import entitybean.oc_sea_area_ben.EntityBeanOc_Sea_Area_Ben;
import entitybean.oc_sea_area_ice.EntityBeanOc_Sea_Area_Ice;
import entitybean.oc_sea_area_pla.EntityBeanOc_Sea_Area_Pla;
import entitybean.oc_station.EntityBeanOc_Station;
import entitybean.oc_station_ben.EntityBeanOc_Station_Ben;
import entitybean.oc_station_ice.EntityBeanOc_Station_Ice;
import entitybean.oc_station_pla.EntityBeanOc_Station_Pla;
import entitybean.oc_user_name.EntityBeanOc_User_Name;
import form.CompareSearchForm;
import form.Property_Tools_Max_Min;
import form.View_Property_Tools;
import form.View_Property_Tools_Ben;
import form.View_Property_Tools_Ice;
import form.View_Property_Tools_Pla;
import service.service_login.Service_Login;
import service.service_public.Service_Public;
import service.service_search.Service_Search;
import tools.DataBaseConn;
import tools.Read_Properties;

public class Action_Search extends DispatchAction {
	private Service_Public service_public;
	private Service_Login service_login;
	private Service_Search service_search;

	public Service_Search getService_search() {
		return service_search;
	}

	public void setService_search(Service_Search serviceSearch) {
		service_search = serviceSearch;
	}
	

	public Service_Public getService_public() {
		return service_public;
	}

	public void setService_public(Service_Public servicePublic) {
		service_public = servicePublic;
	}

	public Service_Login getService_login() {
		return service_login;
	}

	public void setService_login(Service_Login serviceLogin) {
		service_login = serviceLogin;
	}

/*	
	public ActionForward CompareSearch(ActionMapping mapping, ActionForm form,
			HttpServletRequest request, HttpServletResponse response)
			throws SQLException {
		CompareSearchForm f = (CompareSearchForm) form;
		String function = f.getFunction();
		String kekaoA = f.getKekaoA();
		String kekaoB = f.getKekaoB();
		String kekaoC = f.getKekaoC();
		String kekaoD = f.getKekaoD();
		String kekaoE = f.getKekaoE();
		String kekaoF = f.getKekaoF();

		String hangciA = f.getHangciA();
		String hangciB = f.getHangciB();
		String hangciC = f.getHangciC();
		String hangciD = f.getHangciD();
		String hangciE = f.getHangciE();
		String hangciF = f.getHangciF();

		String zhanweiA = f.getZhanweiA();
		String zhanweiB = f.getZhanweiB();
		String zhanweiC = f.getZhanweiC();
		String zhanweiD = f.getZhanweiD();
		String zhanweiE = f.getZhanweiD();
		String zhanweiF = f.getZhanweiF();

		String h_zhanweiG_A = f.getH_zhanweiG_A();
		String h_zhanweiG_B = f.getH_zhanweiG_B();
		String h_zhanweiG_C = f.getH_zhanweiG_C();
		String h_zhanweiG_D = f.getH_zhanweiG_D();
		String h_zhanweiG_E = f.getH_zhanweiG_E();
		String h_zhanweiG_F = f.getH_zhanweiG_F();

		String depA = f.getDepA();
		String depB = f.getDepB();
		String depC = f.getDepC();
		String depD = f.getDepD();
		String depE = f.getDepE();
		String depF = f.getDepF();

		String P_A = f.getP_a();
		String PTOOL_A = f.getPTOOL_A();
		String MIN_A = f.getMIN_A();
		String MAX_A = f.getMAX_A();

		String P_B = f.getP_b();
		String PTOOL_B = f.getPTOOL_B();
		String MIN_B = f.getMIN_B();
		String MAX_B = f.getMAX_B();

		String P_C = f.getP_c();
		String PTOOL_C = f.getPTOOL_C();
		String MIN_C = f.getMIN_C();
		String MAX_C = f.getMAX_C();

		String P_D = f.getP_d();
		String PTOOL_D = f.getPTOOL_D();
		String MIN_D = f.getMIN_D();
		String MAX_D = f.getMAX_D();

		String P_E = f.getP_e();
		String PTOOL_E = f.getPTOOL_E();
		String MIN_E = f.getMIN_E();
		String MAX_E = f.getMAX_E();

		String P_F = f.getP_f();
		String PTOOL_F = f.getPTOOL_F();
		String MIN_F = f.getMIN_F();
		String MAX_F = f.getMAX_F();

		System.out.println("function=" + function);
		System.out.println("kekaoA=" + kekaoA);
		System.out.println("kekaoB=" + kekaoB);
		System.out.println("kekaoC=" + kekaoC);
		System.out.println("kekaoD=" + kekaoD);
		System.out.println("kekaoE=" + kekaoE);
		System.out.println("kekaoF=" + kekaoF);
		System.out.println("hangciA=" + hangciA);
		System.out.println("hangciB=" + hangciB);
		System.out.println("hangciC=" + hangciC);
		System.out.println("hangciD=" + hangciD);
		System.out.println("hangciE=" + hangciE);
		System.out.println("hangciF=" + hangciF);
		System.out.println("zhanweiA=" + zhanweiA);
		System.out.println("zhanweiB=" + zhanweiB);
		System.out.println("zhanweiC=" + zhanweiC);
		System.out.println("zhanweiD=" + zhanweiD);
		System.out.println("zhanweiE=" + zhanweiE);
		System.out.println("zhanweiF=" + zhanweiF);
		System.out.println("h_zhanweiG_A=" + h_zhanweiG_A);
		System.out.println("h_zhanweiG_B=" + h_zhanweiG_B);
		System.out.println("h_zhanweiG_C=" + h_zhanweiG_C);
		System.out.println("h_zhanweiG_D=" + h_zhanweiG_D);
		System.out.println("h_zhanweiG_E=" + h_zhanweiG_E);
		System.out.println("h_zhanweiG_F=" + h_zhanweiG_F);
		System.out.println("depA=" + depA);
		System.out.println("depB=" + depB);
		System.out.println("depC=" + depC);
		System.out.println("depD=" + depD);
		System.out.println("depE=" + depE);
		System.out.println("depF=" + depF);
		System.out.println("P_A=" + P_A);
		System.out.println("P_B=" + P_B);
		System.out.println("P_C=" + P_C);
		System.out.println("P_D=" + P_D);
		System.out.println("P_E=" + P_E);
		System.out.println("P_F=" + P_F);
		System.out.println("PTOOL_A=" + PTOOL_A);
		System.out.println("PTOOL_B=" + PTOOL_B);
		System.out.println("PTOOL_C=" + PTOOL_C);
		System.out.println("PTOOL_D=" + PTOOL_D);
		System.out.println("PTOOL_E=" + PTOOL_E);
		System.out.println("PTOOL_F=" + PTOOL_F);
		System.out.println("MIN_A=" + MIN_A);
		System.out.println("MIN_B=" + MIN_B);
		System.out.println("MIN_C=" + MIN_C);
		System.out.println("MIN_D=" + MIN_D);
		System.out.println("MIN_E=" + MIN_E);
		System.out.println("MIN_F=" + MIN_F);
		System.out.println("MAX_A=" + MAX_A);
		System.out.println("MAX_B=" + MAX_B);
		System.out.println("MAX_C=" + MAX_C);
		System.out.println("MAX_D=" + MAX_D);
		System.out.println("MAX_E=" + MAX_E);
		System.out.println("MAX_F=" + MAX_F);
		String oc_depthlist = depA;
		if (depB != "") {
			oc_depthlist = oc_depthlist + "," + depB;
		}
		if (depC != "") {
			oc_depthlist = oc_depthlist + "," + depC;
		}

		if (depD != "") {
			oc_depthlist = oc_depthlist + "," + depD;
		}
		if (depE != "") {
			oc_depthlist = oc_depthlist + "," + depE;
		}
		if (depF != "") {
			oc_depthlist = oc_depthlist + "," + depF;
		}

		Read_Properties Read_Properties = new Read_Properties(
				"db_cn.properties");
		String ip = Read_Properties.Read_Properties_root("ip");
		String port = Read_Properties.Read_Properties_root("port");
		String service = Read_Properties.Read_Properties_root("servicname");
		String username = Read_Properties.Read_Properties_root("username");
		String password = Read_Properties.Read_Properties_root("password");
		DataBaseConn databaseconn = new DataBaseConn(ip, port, service,
				username, password);
		ResultSet rs = null;
		String sql = "";
		String xmldate = "";
		String tabledata = "";
		System.out.println("����ύ�������ɲ�ѯָ��");
		System.out.println("������,����,������Сֵ��ϳ���Ӧ�ļ��ϣ���ϲ�������Ӧ�Ĳ�ѯ");
		List<EnitityBeanOc_Date_Sur> data = new ArrayList<EnitityBeanOc_Date_Sur>();
		// List<Property_Tools_Max_Min> p_list = new
		// ArrayList<Property_Tools_Max_Min>();
		List<String> sql_list = new ArrayList<String>();
		Property_Tools_Max_Min p = new Property_Tools_Max_Min();

		if (function.equals("A")) {
			System.out.println("ѡ��һվ��");
			tabledata = "<table width='100%'><tr><td>**����һվ�㡿���������ԡ���������ѯ**</td></tr>";
			xmldate = "<chart exportEnabled='1' exportAtClient='1' exportHandler='fcExporter1' caption='**����һվ�㡿���������ԡ���������ѯ**' xAxisName='����'"
					+ " yAxisName='值' showValues='0' numberPrefix='value'>";

			System.out.println("��ȡ������ݵ�ֵ");
			System.out.println("վ���ֵ=" + zhanweiA);
			EntityBeanOc_Station e = this.service_search
					.Find_Oc_Station_by_oc_id(Integer.valueOf(zhanweiA));
			System.out.println("��ȡ��׼վλֵ�ľ�γ��=" + e.getDimensionality() + " "
					+ e.getLongitude());

			System.out.println("----------------------------------");
			System.out.println("ѡ���A");
			System.out.println("���A=" + depA);
			System.out.println("����A=" + P_A);
			System.out.println("����A=" + PTOOL_A);
			System.out.println("���ֵA=" + MAX_A);
			System.out.println("��СֵA=" + MIN_A);
			sql = "select * " + " from OC_DATE_SUR WHERE DEL='OFF' "
					+ " AND OC_VOYAGE_ID=" + kekaoA + " AND OC_STATION_ID IN ("
					+ zhanweiA + ")" + " AND OC_DEPLIST_ID IN(" + oc_depthlist
					+ ") " + " AND OC_PROPERTY_ID=" + P_A
					+ " AND OC_PROPERTY_TOOLS_ID=" + PTOOL_A;
			if (MIN_A != "") {
				sql = sql + " AND VALUE_KEY >=" + MIN_A;
			}
			if (MAX_A != "") {
				sql = sql + " AND VALUE_KEY <=" + MAX_A;
			}
			System.out.println("sql=" + sql);
			sql_list.add(sql);

			System.out.println("----------------------------------");
			System.out.println("ѡ���B");
			System.out.println("����B=" + hangciB);
			EntityBeanOc_Station e2 = this.service_search
					.Find_Oc_Station_by_L_D(e.getLongitude(), e
							.getDimensionality(), hangciB);
			System.out.println("e2.getId()=" + e2.getId());
			if (e2.getId() != null) {
				System.out.println("���ֵ���ͬ��վλ����ʼ��ѯ����");
				sql = "select * " + " from OC_DATE_SUR WHERE DEL='OFF' "
						+ "AND OC_VOYAGE_ID=" + kekaoB
						+ " AND OC_STATION_ID IN (" + e2.getId() + ")"
						+ " AND OC_DEPLIST_ID IN(" + oc_depthlist + ") "
						+ "AND OC_PROPERTY_ID=" + P_B
						+ " AND OC_PROPERTY_TOOLS_ID=" + PTOOL_B;
				if (MIN_C != "") {
					sql = sql + " AND VALUE_KEY >=" + MIN_B;
				}
				if (MAX_B != "") {
					sql = sql + " AND VALUE_KEY <=" + MAX_B;
				}
				System.out.println("sql=" + sql);
				sql_list.add(sql);
			} else {
				System.out.println("δ�ܷ�����ͬվλ�������ѯ����");
			}
			System.out.println("���B=" + depB);
			System.out.println("����B=" + P_B);
			System.out.println("����B=" + PTOOL_B);
			System.out.println("���ֵB=" + MAX_B);
			System.out.println("��СֵB=" + MIN_B);
			System.out.println("----------------------------------");
			System.out.println("ѡ���C");
			System.out.println("����C=" + hangciC);
			EntityBeanOc_Station e3 = this.service_search
					.Find_Oc_Station_by_L_D(e.getLongitude(), e
							.getDimensionality(), hangciC);
			System.out.println("e3.getId()=" + e3.getId());
			if (e3.getId() != null) {
				System.out.println("���ֵ���ͬ��վλ����ʼ��ѯ����");
				sql = "select * " + " from OC_DATE_SUR WHERE DEL='OFF' "
						+ "AND OC_VOYAGE_ID=" + kekaoC
						+ " AND OC_STATION_ID IN (" + e3.getId() + ")"
						+ " AND OC_DEPLIST_ID IN(" + oc_depthlist + ") "
						+ "AND OC_PROPERTY_ID=" + P_C
						+ " AND OC_PROPERTY_TOOLS_ID=" + PTOOL_C;
				if (MIN_C != "") {
					sql = sql + " AND VALUE_KEY >=" + MIN_C;
				}
				if (MAX_C != "") {
					sql = sql + " AND VALUE_KEY <=" + MAX_C;
				}
				System.out.println("sql=" + sql);
				sql_list.add(sql);

			} else {
				System.out.println("δ�ܷ�����ͬվλ�������ѯ����");
			}
			System.out.println("���C=" + depC);
			System.out.println("����C=" + P_C);
			System.out.println("����C=" + PTOOL_C);
			System.out.println("���ֵC=" + MAX_C);
			System.out.println("��СֵC=" + MIN_C);
			System.out.println("----------------------------------");
			System.out.println("ѡ���D");
			System.out.println("����D=" + hangciD);
			EntityBeanOc_Station e4 = this.service_search
					.Find_Oc_Station_by_L_D(e.getLongitude(), e
							.getDimensionality(), hangciD);
			System.out.println("e4.getId()=" + e4.getId());
			if (e4.getId() != null) {
				System.out.println("���ֵ���ͬ��վλ����ʼ��ѯ����");
				sql = "select * " + " from OC_DATE_SUR WHERE DEL='OFF' "
						+ "AND OC_VOYAGE_ID=" + kekaoD
						+ " AND OC_STATION_ID IN (" + e4.getId() + ")"
						+ " AND OC_DEPLIST_ID IN(" + oc_depthlist + ") "
						+ "AND OC_PROPERTY_ID=" + P_D
						+ " AND OC_PROPERTY_TOOLS_ID=" + PTOOL_D;
				if (MIN_D != "") {
					sql = sql + " AND VALUE_KEY >=" + MIN_D;
				}
				if (MAX_D != "") {
					sql = sql + " AND VALUE_KEY <=" + MAX_D;
				}
				System.out.println("sql=" + sql);
				sql_list.add(sql);

			} else {
				System.out.println("δ�ܷ�����ͬվλ�������ѯ����");
			}

			System.out.println("���D=" + depD);
			System.out.println("����D=" + P_D);
			System.out.println("����D=" + PTOOL_D);
			System.out.println("���ֵD=" + MAX_D);
			System.out.println("��СֵD=" + MIN_D);
			System.out.println("----------------------------------");
			System.out.println("ѡ���E");
			System.out.println("����E=" + hangciE);
			EntityBeanOc_Station e5 = this.service_search
					.Find_Oc_Station_by_L_D(e.getLongitude(), e
							.getDimensionality(), hangciE);
			System.out.println("e5.getId()=" + e5.getId());
			if (e5.getId() != null) {

				System.out.println("���ֵ���ͬ��վλ����ʼ��ѯ����");
				sql = "select * " + " from OC_DATE_SUR WHERE DEL='OFF' "
						+ "AND OC_VOYAGE_ID=" + kekaoE
						+ " AND OC_STATION_ID IN (" + e5.getId() + ")"
						+ " AND OC_DEPLIST_ID IN(" + oc_depthlist + ") "
						+ "AND OC_PROPERTY_ID=" + P_E
						+ " AND OC_PROPERTY_TOOLS_ID=" + PTOOL_E;
				if (MIN_E != "") {
					sql = sql + " AND VALUE_KEY >=" + MIN_E;
				}
				if (MAX_E != "") {
					sql = sql + " AND VALUE_KEY <=" + MAX_E;
				}
				System.out.println("sql=" + sql);
				sql_list.add(sql);
			} else {
				System.out.println("δ�ܷ�����ͬվλ�������ѯ����");
			}
			System.out.println("���E=" + depE);
			System.out.println("����E=" + P_E);
			System.out.println("����E=" + PTOOL_E);
			System.out.println("���ֵE=" + MAX_E);
			System.out.println("��СֵE=" + MIN_E);
			System.out.println("----------------------------------");
			System.out.println("ѡ���F");
			System.out.println("����F=" + hangciF);
			EntityBeanOc_Station e6 = this.service_search
					.Find_Oc_Station_by_L_D(e.getLongitude(), e
							.getDimensionality(), hangciF);
			System.out.println("e6.getId()=" + e6.getId());
			if (e6.getId() != null) {

				System.out.println("���ֵ���ͬ��վλ����ʼ��ѯ����");

				sql = "select * " + " from OC_DATE_SUR WHERE DEL='OFF' "
						+ "AND OC_VOYAGE_ID=" + kekaoF
						+ " AND OC_STATION_ID IN (" + e6.getId() + ")"
						+ " AND OC_DEPLIST_ID IN(" + oc_depthlist + ") "
						+ "AND OC_PROPERTY_ID=" + P_F
						+ " AND OC_PROPERTY_TOOLS_ID=" + PTOOL_F;
				if (MIN_F != "") {
					sql = sql + " AND VALUE_KEY >=" + MIN_F;
				}
				if (MAX_F != "") {
					sql = sql + " AND VALUE_KEY <=" + MAX_F;
				}
				System.out.println("sql=" + sql);
				sql_list.add(sql);
			} else {
				System.out.println("δ�ܷ�����ͬվλ�������ѯ����");
			}
			System.out.println("���F=" + depF);
			System.out.println("����F=" + P_F);
			System.out.println("����F=" + PTOOL_F);
			System.out.println("���ֵF=" + MAX_F);
			System.out.println("��СֵF=" + MIN_F);
			System.out.println("----------------------------------");

			sql = "select depth from OC_DEPTHLIST where id in (" + oc_depthlist
					+ ") and del='OFF' order by depth";
			try {
				rs = databaseconn.getStmt().executeQuery(sql);
				xmldate = xmldate + "<categories>";
				tabledata = tabledata + "<tr>" + "<td>" + "属性/层深" + "</td>";// �����ı��ı?
				while (rs.next()) {
					xmldate = xmldate + "<category label='"
							+ rs.getString("depth") + "(M)' />";
					tabledata = tabledata + "<td>" + rs.getString("depth")
							+ "(M)" + "</td>";
				}
				xmldate = xmldate + "</categories>";
				tabledata = tabledata + "</tr>";
			} catch (SQLException e1) {

				e1.printStackTrace();
			}

			// ƴ������ַ�
			// System.out.println("p_list.size()=" + p_list.size());

			System.out.println("ִ����ݿ����....");
			for (int i = 0; i < sql_list.size(); i++) {
				try {
					rs = databaseconn.getStmt().executeQuery(sql_list.get(i));
					System.out.println("���ִ�гɹ�");
					while (rs.next()) {// ��ȡ��ݿ���ݵ��������Ա㴦�?
						EnitityBeanOc_Date_Sur e1 = new EnitityBeanOc_Date_Sur();
						e1.setDel(rs.getString("DEL"));
						e1.setId(rs.getInt("ID"));
						e1.setOc_deplist_id(rs.getInt("OC_DEPLIST_ID"));
						e1.setOc_property_id(rs.getInt("OC_PROPERTY_ID"));
						e1.setOc_property_tools_id(rs
								.getInt("OC_PROPERTY_TOOLS_ID"));
						e1.setOc_station_id(rs.getInt("OC_STATION_ID"));
						e1.setOc_voyage_id(rs.getInt("OC_VOYAGE_ID"));
						e1.setValue_key(rs.getDouble("VALUE_KEY"));
						data.add(e1);// ��ͬ�ֵĲ��������Ϊ��ݵĲ������Ե��� data
										// �ĳ��ȺͲ���ĳ��Ȳ����
					}
					System.out.println("��ݼ��ϵĴ�С=" + data.size());
					System.out.println("��ʼƴ����Ӧ�� XML���....");
					if (data.size() > 0) {
						sql = "select PROPERTY_NAME from OC_PROPERTY where ID="
								+ data.get(0).getOc_property_id();
						rs = databaseconn.getStmt().executeQuery(sql);
						String property_name = "";
						String property_tools = "";
						if (rs.next()) {
							property_name = rs.getString("PROPERTY_NAME");

						}
						sql = "select TOOLS_NAME from OC_PROPERTY_TOOLS where ID="
								+ data.get(0).getOc_property_tools_id();
						rs = databaseconn.getStmt().executeQuery(sql);
						if (rs.next()) {
							property_tools = rs.getString("TOOLS_NAME");

						}
						xmldate = xmldate + "<dataset seriesName='"
								+ property_name + "(" + property_tools + ")'> ";
						tabledata = tabledata + "<tr><td>" + property_name
								+ "(" + property_tools + ")</td>";

					} else {
						tabledata = tabledata + "<tr><td>" + "null" + "("
								+ "null" + ")</td>";
					}
					String d[] = oc_depthlist.split(",");// ת��ʽ���ַ�����
					List<Integer> dep_list = new ArrayList();
					for (int k = 0; k < d.length; k++)// �Բ�������Ϊ��־������ѯ������
					{
						System.out
								.println("��ʾ��ѯ��¼�в��������ֵ"
										+ d[k]
										+ ",ѭ�������ݽ���е�ֵ��������������Ч��� ��û�з�������ӿ���ֵ");
						String AddEmpty = "yes";
						String value = "";
						for (int j = 0; j < data.size(); j++) {
							if (data.get(j).getOc_deplist_id().toString()
									.equals(d[k])) {
								value = data.get(j).getValue_key().toString();
								AddEmpty = "not";
								break;
							}
						}
						if (AddEmpty.endsWith("yes")) {

							xmldate = xmldate + "<set value='" + "'/>";
							tabledata = tabledata + "<td>" + "null" + "</td>";

						} else {

							xmldate = xmldate + "<set value='" + value + "'/>";
							tabledata = tabledata + "<td>" + value + "</td>";

						}

					}
					if (data.size() > 0) {
						xmldate = xmldate + "</dataset>";
						tabledata = tabledata + "</tr>";
						data.clear();
					}

				} catch (SQLException e41) {
					// TODO Auto-generated catch block
					e41.printStackTrace();
				}
			}

			xmldate = xmldate
					+ "<styles><definition><style name='CanvasAnim' type='animation' param='_xScale' start='0' duration='1' />"
					+ "</definition><application><apply toObject='Canvas' styles='CanvasAnim' /></application></styles></chart>";
			tabledata = tabledata + "</table>";

		} else if (function.equals("B")) {
			System.out.println("ѡ��һ����");
			tabledata = "<table width='100%'><tr><td>**����վ�㡿���������ԡ�����һ�����ѯ**</td></tr>";
			xmldate = "<chart exportEnabled='1' exportAtClient='1' exportHandler='fcExporter1' caption='**����վ�㡿���������ԡ�����һ�����ѯ**' **单一站点多层深多属性比较查询**"
					+ " yAxisName='值' showValues='0' numberPrefix='value'>";

			System.out.println("��ȡ���е�վ��ֵ");
			System.out.println("h_zhanweiG_A=" + h_zhanweiG_A);
			System.out.println("h_zhanweiG_B=" + h_zhanweiG_B);
			System.out.println("h_zhanweiG_C=" + h_zhanweiG_C);
			System.out.println("h_zhanweiG_D=" + h_zhanweiG_D);
			System.out.println("h_zhanweiG_E=" + h_zhanweiG_E);
			System.out.println("h_zhanweiG_F=" + h_zhanweiG_F);
			String zhanweiString = "";
			if (!h_zhanweiG_A.equals("")) {
				zhanweiString = zhanweiString + this.cut_tail(h_zhanweiG_A);
			}
			if (!h_zhanweiG_B.equals("")) {
				zhanweiString = zhanweiString + ","
						+ this.cut_tail(h_zhanweiG_B);

			}
			if (!h_zhanweiG_C.equals("")) {
				zhanweiString = zhanweiString + ","
						+ this.cut_tail(h_zhanweiG_C);

			}
			if (!h_zhanweiG_D.equals("")) {
				zhanweiString = zhanweiString + ","
						+ this.cut_tail(h_zhanweiG_D);

			}
			if (!h_zhanweiG_E.equals("")) {
				zhanweiString = zhanweiString + ","
						+ this.cut_tail(h_zhanweiG_E);

			}
			if (!h_zhanweiG_F.equals("")) {
				zhanweiString = zhanweiString + ","
						+ this.cut_tail(h_zhanweiG_F);

			}
			System.out.println("zhanweiString=" + zhanweiString);
			System.out.println("����վλ��Ϣ,��ѯ��ݿ���վ����Ϣ������X��");
			sql = "select * from OC_STATION where DEL='OFF' AND ID in ("
					+ zhanweiString + ")";
			rs = databaseconn.getStmt().executeQuery(sql);

			xmldate = xmldate + "<categories>";
			tabledata = tabledata + "<tr>" + "<td>" + "属性/站点" + "</td>";// �����ı��ı?
			String link = "";
			while (rs.next()) {
				System.out.println("�Ѿ���ȡ���,��ʼƴ��X��");
				xmldate = xmldate + "<category label='"
						+ rs.getString("STATION_NAME") + "'/>";
				tabledata = tabledata + "<td>" + rs.getString("STATION_NAME")
						+ "</td>";

				link = link + rs.getString("ID") + ",";
			}
			link = this.cut_tail(link);// ͨ����ݿ����վ�������
			xmldate = xmldate + "</categories>";
			tabledata = tabledata + "</tr>";

			System.out.println("��ʼƴ����ʾ����ֵ���,��ȡ��һ���?��ֵ");
			List<String> temp_sql_list = new ArrayList<String>();
			h_zhanweiG_A = this.cut_tail(h_zhanweiG_A);
			h_zhanweiG_B = this.cut_tail(h_zhanweiG_B);
			h_zhanweiG_C = this.cut_tail(h_zhanweiG_C);
			h_zhanweiG_D = this.cut_tail(h_zhanweiG_D);
			h_zhanweiG_E = this.cut_tail(h_zhanweiG_E);
			h_zhanweiG_F = this.cut_tail(h_zhanweiG_F);

			temp_sql_list = this.make_sql_list_for_funtionB(h_zhanweiG_A,
					hangciA, depA, P_A, PTOOL_A, MIN_A, MAX_A);
			for (int temp = 0; temp < temp_sql_list.size(); temp++) {
				sql_list.add(temp_sql_list.get(temp));
			}

			temp_sql_list = this.make_sql_list_for_funtionB(h_zhanweiG_B,
					hangciB, depA, P_B, PTOOL_B, MIN_B, MAX_B);
			for (int temp = 0; temp < temp_sql_list.size(); temp++) {
				sql_list.add(temp_sql_list.get(temp));
			}

			temp_sql_list = this.make_sql_list_for_funtionB(h_zhanweiG_C,
					hangciC, depA, P_C, PTOOL_C, MIN_C, MAX_C);
			for (int temp = 0; temp < temp_sql_list.size(); temp++) {
				sql_list.add(temp_sql_list.get(temp));
			}

			temp_sql_list = this.make_sql_list_for_funtionB(h_zhanweiG_D,
					hangciD, depA, P_D, PTOOL_D, MIN_D, MAX_D);
			for (int temp = 0; temp < temp_sql_list.size(); temp++) {
				sql_list.add(temp_sql_list.get(temp));
			}

			temp_sql_list = this.make_sql_list_for_funtionB(h_zhanweiG_E,
					hangciE, depA, P_E, PTOOL_E, MIN_E, MAX_E);
			for (int temp = 0; temp < temp_sql_list.size(); temp++) {
				sql_list.add(temp_sql_list.get(temp));
			}

			temp_sql_list = this.make_sql_list_for_funtionB(h_zhanweiG_F,
					hangciF, depA, P_F, PTOOL_F, MIN_F, MAX_F);
			for (int temp = 0; temp < temp_sql_list.size(); temp++) {
				sql_list.add(temp_sql_list.get(temp));
			}

			System.out.println("sql_list.size()=" + sql_list.size());
			for (int s_all = 0; s_all < sql_list.size(); s_all++) {
				System.out.println(sql_list.get(s_all));
				rs = databaseconn.getStmt().executeQuery(sql_list.get(s_all));
				System.out
						.println("�����ݲ�Ϊ�գ�����Ҫ���һ�����ͼ��,ͬʱҪ����һ����������");
				xmldate = xmldate + this.Link_DataDraw_FunctionB_Xml(rs, link);
				tabledata = tabledata
						+ this.Link_DataDraw_FunctionB_Tab(rs, link);
			}

			xmldate = xmldate
					+ "<styles><definition><style name='CanvasAnim' type='animation' param='_xScale' start='0' duration='1' />"
					+ "</definition><application><apply toObject='Canvas' styles='CanvasAnim' /></application></styles></chart>";
			tabledata = tabledata + "</table>";

		} else if (function.equals("C")) {
			System.out.println("ѡ��һ����");
			tabledata = "<table width='100%'><tr><td>**单一层深多层深多属性比较查询**</td></tr>";
			xmldate = "<chart exportEnabled='1' exportAtClient='1' exportHandler='fcExporter1' caption='**单一层深多层深多属性比较查询**' **单一站点多层深多属性比较查询**"
					+ " yAxisName='值' showValues='0' numberPrefix='value'>";

			System.out.println("��ȡ���е�վ��ֵ");
			System.out.println("h_zhanweiG_A=" + h_zhanweiG_A);
			System.out.println("h_zhanweiG_B=" + h_zhanweiG_B);
			System.out.println("h_zhanweiG_C=" + h_zhanweiG_C);
			System.out.println("h_zhanweiG_D=" + h_zhanweiG_D);
			System.out.println("h_zhanweiG_E=" + h_zhanweiG_E);
			System.out.println("h_zhanweiG_F=" + h_zhanweiG_F);
			String zhanweiString = "";
			if (!h_zhanweiG_A.equals("")) {
				zhanweiString = zhanweiString + this.cut_tail(h_zhanweiG_A);
			}
			if (!h_zhanweiG_B.equals("")) {
				zhanweiString = zhanweiString + ","
						+ this.cut_tail(h_zhanweiG_B);

			}
			if (!h_zhanweiG_C.equals("")) {
				zhanweiString = zhanweiString + ","
						+ this.cut_tail(h_zhanweiG_C);

			}
			if (!h_zhanweiG_D.equals("")) {
				zhanweiString = zhanweiString + ","
						+ this.cut_tail(h_zhanweiG_D);

			}
			if (!h_zhanweiG_E.equals("")) {
				zhanweiString = zhanweiString + ","
						+ this.cut_tail(h_zhanweiG_E);

			}
			if (!h_zhanweiG_F.equals("")) {
				zhanweiString = zhanweiString + ","
						+ this.cut_tail(h_zhanweiG_F);

			}
			System.out.println("zhanweiString=" + zhanweiString);
			System.out.println("����վλ��Ϣ,��ѯ��ݿ���վ����Ϣ������X��");
			sql = "select * from OC_STATION where DEL='OFF' AND ID in ("
					+ zhanweiString + ")";
			rs = databaseconn.getStmt().executeQuery(sql);

			xmldate = xmldate + "<categories>";
			tabledata = tabledata + "<tr>" + "<td>" + "���/վ��" + "</td>";// �����ı��ı?
			String link = "";
			while (rs.next()) {
				System.out.println("�Ѿ���ȡ���,��ʼƴ��X��");
				xmldate = xmldate + "<category label='"
						+ rs.getString("STATION_NAME") + "'/>";
				tabledata = tabledata + "<td>" + rs.getString("STATION_NAME")
						+ "</td>";

				link = link + rs.getString("ID") + ",";
			}
			link = this.cut_tail(link);// ͨ����ݿ����վ�������

			link = this.cut_tail(link);// ͨ����ݿ����վ�������
			xmldate = xmldate + "</categories>";
			tabledata = tabledata + "</tr>";

			System.out.println("��ʼƴ����ʾ����ֵ���,��ȡ��һ���?��ֵ");
			List<String> temp_sql_list = new ArrayList<String>();
			h_zhanweiG_A = this.cut_tail(h_zhanweiG_A);
			h_zhanweiG_B = this.cut_tail(h_zhanweiG_B);
			h_zhanweiG_C = this.cut_tail(h_zhanweiG_C);
			h_zhanweiG_D = this.cut_tail(h_zhanweiG_D);
			h_zhanweiG_E = this.cut_tail(h_zhanweiG_E);
			h_zhanweiG_F = this.cut_tail(h_zhanweiG_F);

			temp_sql_list = this.make_sql_list_for_funtionC(h_zhanweiG_A,
					hangciA, depA, P_A, PTOOL_A, MIN_A, MAX_A);
			for (int temp = 0; temp < temp_sql_list.size(); temp++) {
				sql_list.add(temp_sql_list.get(temp));
			}

			temp_sql_list = this.make_sql_list_for_funtionC(h_zhanweiG_B,
					hangciB, depB, P_A, PTOOL_A, MIN_A, MAX_A);
			for (int temp = 0; temp < temp_sql_list.size(); temp++) {
				sql_list.add(temp_sql_list.get(temp));
			}

			temp_sql_list = this.make_sql_list_for_funtionC(h_zhanweiG_C,
					hangciC, depC, P_A, PTOOL_A, MIN_A, MAX_A);
			for (int temp = 0; temp < temp_sql_list.size(); temp++) {
				sql_list.add(temp_sql_list.get(temp));
			}

			temp_sql_list = this.make_sql_list_for_funtionC(h_zhanweiG_D,
					hangciD, depD, P_A, PTOOL_A, MIN_A, MAX_A);
			for (int temp = 0; temp < temp_sql_list.size(); temp++) {
				sql_list.add(temp_sql_list.get(temp));
			}

			temp_sql_list = this.make_sql_list_for_funtionC(h_zhanweiG_E,
					hangciE, depE, P_A, PTOOL_A, MIN_A, MAX_A);
			for (int temp = 0; temp < temp_sql_list.size(); temp++) {
				sql_list.add(temp_sql_list.get(temp));
			}

			temp_sql_list = this.make_sql_list_for_funtionC(h_zhanweiG_F,
					hangciF, depF, P_A, PTOOL_A, MIN_A, MAX_A);
			for (int temp = 0; temp < temp_sql_list.size(); temp++) {
				sql_list.add(temp_sql_list.get(temp));
			}
			System.out.println("sql_list.size()=" + sql_list.size());

			for (int s_all = 0; s_all < sql_list.size(); s_all++) {
				System.out.println(sql_list.get(s_all));
				rs = databaseconn.getStmt().executeQuery(sql_list.get(s_all));
				System.out
						.println("�����ݲ�Ϊ�գ�����Ҫ���һ�����ͼ��,ͬʱҪ����һ����������");
				xmldate = xmldate + this.Link_DataDraw_FunctionC_Xml(rs, link);
				tabledata = tabledata
						+ this.Link_DataDraw_FunctionC_Tab(rs, link);
			}

			xmldate = xmldate
					+ "<styles><definition><style name='CanvasAnim' type='animation' param='_xScale' start='0' duration='1' />"
					+ "</definition><application><apply toObject='Canvas' styles='CanvasAnim' /></application></styles></chart>";
			tabledata = tabledata + "</table>";
		}
		System.out.println("tabledata=" + tabledata);
		System.out.println("xmldate=" + xmldate);
		databaseconn = null;// �ر���ݿ�����
		request.setAttribute("tabledata", tabledata);// �׳��������
		request.setAttribute("xmldate", xmldate);
		return mapping.findForward("success");

	}
	*/
	public ActionForward CompareSearch(ActionMapping mapping, ActionForm form,
			HttpServletRequest request, HttpServletResponse response)
			throws SQLException {
		
		CompareSearchForm f = (CompareSearchForm) form;
		String function = f.getFunction();
		String kekaoA = f.getKekaoA();
		String kekaoB = f.getKekaoB();
		String kekaoC = f.getKekaoC();
		String kekaoD = f.getKekaoD();
		String kekaoE = f.getKekaoE();
		String kekaoF = f.getKekaoF();

		String hangciA = f.getHangciA();
		String hangciB = f.getHangciB();
		String hangciC = f.getHangciC();
		String hangciD = f.getHangciD();
		String hangciE = f.getHangciE();
		String hangciF = f.getHangciF();

		String zhanweiA = f.getZhanweiA();
		String zhanweiB = f.getZhanweiB();
		String zhanweiC = f.getZhanweiC();
		String zhanweiD = f.getZhanweiD();
		String zhanweiE = f.getZhanweiD();
		String zhanweiF = f.getZhanweiF();

		String h_zhanweiG_A = f.getH_zhanweiG_A();
		String h_zhanweiG_B = f.getH_zhanweiG_B();
		String h_zhanweiG_C = f.getH_zhanweiG_C();
		String h_zhanweiG_D = f.getH_zhanweiG_D();
		String h_zhanweiG_E = f.getH_zhanweiG_E();
		String h_zhanweiG_F = f.getH_zhanweiG_F();

		String depA = f.getDepA();
		String depB = f.getDepB();
		String depC = f.getDepC();
		String depD = f.getDepD();
		String depE = f.getDepE();
		String depF = f.getDepF();

		String P_A = f.getP_a();
		String PTOOL_A = f.getPTOOL_A();
		String MIN_A = f.getMIN_A();
		String MAX_A = f.getMAX_A();

		String P_B = f.getP_b();
		String PTOOL_B = f.getPTOOL_B();
		String MIN_B = f.getMIN_B();
		String MAX_B = f.getMAX_B();

		String P_C = f.getP_c();
		String PTOOL_C = f.getPTOOL_C();
		String MIN_C = f.getMIN_C();
		String MAX_C = f.getMAX_C();

		String P_D = f.getP_d();
		String PTOOL_D = f.getPTOOL_D();
		String MIN_D = f.getMIN_D();
		String MAX_D = f.getMAX_D();

		String P_E = f.getP_e();
		String PTOOL_E = f.getPTOOL_E();
		String MIN_E = f.getMIN_E();
		String MAX_E = f.getMAX_E();

		String P_F = f.getP_f();
		String PTOOL_F = f.getPTOOL_F();
		String MIN_F = f.getMIN_F();
		String MAX_F = f.getMAX_F();
		String oc_depthlist = depA;
		if (depB != "") {
			oc_depthlist = oc_depthlist + "," + depB;
		}
		if (depC != "") {
			oc_depthlist = oc_depthlist + "," + depC;
		}

		if (depD != "") {
			oc_depthlist = oc_depthlist + "," + depD;
		}
		if (depE != "") {
			oc_depthlist = oc_depthlist + "," + depE;
		}
		if (depF != "") {
			oc_depthlist = oc_depthlist + "," + depF;
		}

		Read_Properties Read_Properties = new Read_Properties(
				"db_cn.properties");
		String ip = Read_Properties.Read_Properties_root("ip");
		String port = Read_Properties.Read_Properties_root("port");
		String service = Read_Properties.Read_Properties_root("servicname");
		String username = Read_Properties.Read_Properties_root("username");
		String password = Read_Properties.Read_Properties_root("password");
		DataBaseConn databaseconn = new DataBaseConn(ip, port, service,
				username, password);
		ResultSet rs = null;
		String sql = "";
		String xmldate = "";
		String tabledata = "";
		List<EnitityBeanOc_Date_Sur> data = new ArrayList<EnitityBeanOc_Date_Sur>();

		List<String> sql_list = new ArrayList<String>();
		Property_Tools_Max_Min p = new Property_Tools_Max_Min();

		if (function.equals("A")) {
			tabledata = "<table width='100%'><tr><td>**单一站点多层深多属性比较查询**</td></tr>";
			xmldate = "<chart exportEnabled='1' exportAtClient='1' exportHandler='fcExporter1' caption='**单一站点多层深多属性比较查询**' xAxisName='层深'"
					+ " yAxisName='值' showValues='0' numberPrefix='value'>";
			EntityBeanOc_Station e = this.service_search
					.Find_Oc_Station_by_oc_id(Integer.valueOf(zhanweiA));
			sql = "select * " + " from OC_DATE_SUR WHERE DEL='OFF' "
					+ " AND OC_VOYAGE_ID=" + hangciA + " AND OC_STATION_ID IN ("
					+ zhanweiA + ")" + " AND OC_DEPLIST_ID IN(" + oc_depthlist
					+ ") " + " AND OC_PROPERTY_ID=" + P_A
					+ " AND OC_PROPERTY_TOOLS_ID=" + PTOOL_A;
			if (MIN_A != "") {
				sql = sql + " AND VALUE_KEY >=" + MIN_A;
			}
			if (MAX_A != "") {
				sql = sql + " AND VALUE_KEY <=" + MAX_A;
			}
			System.out.println("sql=" + sql);
			sql_list.add(sql);
            if(!"-1".endsWith(kekaoB)&& kekaoB!="-1"){
			EntityBeanOc_Station e2 = this.service_search.Find_Oc_Station_by_L_D(e.getLongitude(), e
							.getDimensionality(), hangciB);

			if (e2.getId() != null) {
				sql = "select * " + " from OC_DATE_SUR WHERE DEL='OFF' "
						+ "AND OC_VOYAGE_ID=" + hangciB
						+ " AND OC_STATION_ID IN (" + e2.getId() + ")"
						+ " AND OC_DEPLIST_ID IN(" + oc_depthlist + ") "
						+ "AND OC_PROPERTY_ID=" + P_B
						+ " AND OC_PROPERTY_TOOLS_ID=" + PTOOL_B;
				if (MIN_C != "") {
					sql = sql + " AND VALUE_KEY >=" + MIN_B;
				}
				if (MAX_B != "") {
					sql = sql + " AND VALUE_KEY <=" + MAX_B;
				}
				System.out.println("sql=" + sql);
				sql_list.add(sql);
			} else {
				System.out.println("δ�ܷ�����ͬվλ�������ѯ����");
			}
            }
            if(!"-1".endsWith(kekaoC)&& kekaoC!="-1"){
			EntityBeanOc_Station e3 = this.service_search
					.Find_Oc_Station_by_L_D(e.getLongitude(), e
							.getDimensionality(), hangciC);
			System.out.println("e3.getId()=" + e3.getId());
			if (e3.getId() != null) {
				
				sql = "select * " + " from OC_DATE_SUR WHERE DEL='OFF' "
						+ "AND OC_VOYAGE_ID=" + hangciC
						+ " AND OC_STATION_ID IN (" + e3.getId() + ")"
						+ " AND OC_DEPLIST_ID IN(" + oc_depthlist + ") "
						+ "AND OC_PROPERTY_ID=" + P_C
						+ " AND OC_PROPERTY_TOOLS_ID=" + PTOOL_C;
				if (MIN_C != "") {
					sql = sql + " AND VALUE_KEY >=" + MIN_C;
				}
				if (MAX_C != "") {
					sql = sql + " AND VALUE_KEY <=" + MAX_C;
				}
				System.out.println("sql=" + sql);
				sql_list.add(sql);

			} else {
				System.out.println("δ�ܷ�����ͬվλ�������ѯ����");
			}
            }
            if(!"-1".endsWith(kekaoD)&& kekaoD!="-1"){
			EntityBeanOc_Station e4 = this.service_search
					.Find_Oc_Station_by_L_D(e.getLongitude(), e.getDimensionality(), hangciD);
			System.out.println("e4.getId()=" + e4.getId());
			if (e4.getId() != null) {
				sql = "select * " + " from OC_DATE_SUR WHERE DEL='OFF' "
						+ "AND OC_VOYAGE_ID=" + hangciD
						+ " AND OC_STATION_ID IN (" + e4.getId() + ")"
						+ " AND OC_DEPLIST_ID IN(" + oc_depthlist + ") "
						+ "AND OC_PROPERTY_ID=" + P_D
						+ " AND OC_PROPERTY_TOOLS_ID=" + PTOOL_D;
				if (MIN_D != "") {
					sql = sql + " AND VALUE_KEY >=" + MIN_D;
				}
				if (MAX_D != "") {
					sql = sql + " AND VALUE_KEY <=" + MAX_D;
				}
				System.out.println("sql=" + sql);
				sql_list.add(sql);

			} else {
				System.out.println("δ�ܷ�����ͬվλ�������ѯ����");
			}
            }
            if(!"-1".endsWith(kekaoE)&& kekaoE!="-1"){
			EntityBeanOc_Station e5 = this.service_search
					.Find_Oc_Station_by_L_D(e.getLongitude(), e
							.getDimensionality(), hangciE);
			System.out.println("e5.getId()=" + e5.getId());
			if (e5.getId() != null) {
				sql = "select * " + " from OC_DATE WHERE DEL='OFF' "
						+ "AND OC_VOYAGE_ID=" + hangciE
						+ " AND OC_STATION_ID IN (" + e5.getId() + ")"
						+ " AND OC_DEPLIST_ID IN(" + oc_depthlist + ") "
						+ "AND OC_PROPERTY_ID=" + P_E
						+ " AND OC_PROPERTY_TOOLS_ID=" + PTOOL_E;
				if (MIN_E != "") {
					sql = sql + " AND VALUE_KEY >=" + MIN_E;
				}
				if (MAX_E != "") {
					sql = sql + " AND VALUE_KEY <=" + MAX_E;
				}
				System.out.println("sql=" + sql);
				sql_list.add(sql);
			} else {
				System.out.println("δ�ܷ�����ͬվλ�������ѯ����");
			}
            }
            if(!"-1".endsWith(kekaoF)&& kekaoF!="-1"){
			EntityBeanOc_Station e6 = this.service_search
					.Find_Oc_Station_by_L_D(e.getLongitude(), e
							.getDimensionality(), hangciF);
			System.out.println("e6.getId()=" + e6.getId());
			if (e6.getId() != null) {

				sql = "select * " + " from OC_DATE_SUR WHERE DEL='OFF' "
						+ "AND OC_VOYAGE_ID=" + hangciF
						+ " AND OC_STATION_ID IN (" + e6.getId() + ")"
						+ " AND OC_DEPLIST_ID IN(" + oc_depthlist + ") "
						+ "AND OC_PROPERTY_ID=" + P_F
						+ " AND OC_PROPERTY_TOOLS_ID=" + PTOOL_F;
				if (MIN_F != "") {
					sql = sql + " AND VALUE_KEY >=" + MIN_F;
				}
				if (MAX_F != "") {
					sql = sql + " AND VALUE_KEY <=" + MAX_F;
				}
				System.out.println("sql=" + sql);
				sql_list.add(sql);
			} else {
				System.out.println("δ�ܷ�����ͬվλ�������ѯ����");
			}
            }
			sql = "select depth from oc_depthlist where id in (" + oc_depthlist
					+ ") and del='OFF' order by depth";
			try {
				rs = databaseconn.getStmt().executeQuery(sql);
				xmldate = xmldate + "<categories>";
				tabledata = tabledata + "<tr>" + "<td>" + "属性/层深" + "</td>";// �����ı��ı?
				while (rs.next()) {
					xmldate = xmldate + "<category label='"
							+ rs.getString("depth") + "(M)' />";
					tabledata = tabledata + "<td>" + rs.getString("depth")
							+ "(M)" + "</td>";
				}
				xmldate = xmldate + "</categories>";
				tabledata = tabledata + "</tr>";
			} catch (SQLException e1) {

				e1.printStackTrace();
			}

			for (int i = 0; i < sql_list.size(); i++) {
				try {
					rs = databaseconn.getStmt().executeQuery(sql_list.get(i));
					while (rs.next()) { 
						EnitityBeanOc_Date_Sur e1 = new EnitityBeanOc_Date_Sur();
						e1.setDel(rs.getString("DEL"));
						e1.setId(rs.getInt("ID"));
						e1.setOc_deplist_id(rs.getInt("OC_DEPLIST_ID"));
						e1.setOc_property_id(rs.getInt("OC_PROPERTY_ID"));
						e1.setOc_property_tools_id(rs
								.getInt("OC_PROPERTY_TOOLS_ID"));
						e1.setOc_station_id(rs.getInt("OC_STATION_ID"));
						e1.setOc_voyage_id(rs.getInt("OC_VOYAGE_ID"));
						e1.setValue_key(rs.getDouble("VALUE_KEY"));
						data.add(e1);
					}
					if (data.size() > 0) {
						sql = "select PROPERTY_NAME from oc_property where ID="
								+ data.get(0).getOc_property_id();
						rs = databaseconn.getStmt().executeQuery(sql);
						String property_name = "";
						String property_tools = "";
						if (rs.next()) {
							property_name = rs.getString("PROPERTY_NAME");

						}
						sql = "select TOOLS_NAME from oc_property_tools where ID="
								+ data.get(0).getOc_property_tools_id();
						rs = databaseconn.getStmt().executeQuery(sql);
						if (rs.next()) {
							property_tools = rs.getString("TOOLS_NAME");

						}
						xmldate = xmldate + "<dataset seriesName='"
								+ property_name + "(" + property_tools + ")'> ";
						tabledata = tabledata + "<tr><td>" + property_name
								+ "(" + property_tools + ")</td>";

					} else {
						tabledata = tabledata + "<tr><td>" + "null" + "("
								+ "null" + ")</td>";
					}
					String d[] = oc_depthlist.split(",");// ת��ʽ���ַ�����
					List<Integer> dep_list = new ArrayList();
					for (int k = 0; k < d.length; k++)// �Բ�������Ϊ��־������ѯ������
					{
						String AddEmpty = "yes";
						String value = "";
						for (int j = 0; j < data.size(); j++) {
							if (data.get(j).getOc_deplist_id().toString()
									.equals(d[k])) {
								value = data.get(j).getValue_key().toString();
								AddEmpty = "not";
								break;
							}
						}
						if (AddEmpty.endsWith("yes")) {

							xmldate = xmldate + "<set value='" + "'/>";
							tabledata = tabledata + "<td>" + "null" + "</td>";

						} else {

							xmldate = xmldate + "<set value='" + value + "'/>";
							tabledata = tabledata + "<td>" + value + "</td>";

						}

					}
					if (data.size() > 0) {
						xmldate = xmldate + "</dataset>";
						tabledata = tabledata + "</tr>";
						data.clear();
					}

				} catch (SQLException e41) {
					// TODO Auto-generated catch block
					e41.printStackTrace();
				}
			}

			xmldate = xmldate
					+ "<styles><definition><style name='CanvasAnim' type='animation' param='_xScale' start='0' duration='1' />"
					+ "</definition><application><apply toObject='Canvas' styles='CanvasAnim' /></application></styles></chart>";
			tabledata = tabledata + "</table>";

		} else if (function.equals("B")) {
			tabledata = "<table width='100%'><tr><td>**单一层深多层深多属性比较查询**</td></tr>";
			xmldate = "<chart exportEnabled='1' exportAtClient='1' exportHandler='fcExporter1' caption='**单一层深多层深多属性比较查询**'"
					+ " yAxisName='值' showValues='0' numberPrefix='value'>";


			String zhanweiString = "";
			if (!h_zhanweiG_A.equals("")) {
				zhanweiString = zhanweiString + this.cut_tail(h_zhanweiG_A);
			}
			if (!h_zhanweiG_B.equals("")) {
				zhanweiString = zhanweiString + ","
						+ this.cut_tail(h_zhanweiG_B);

			}
			if (!h_zhanweiG_C.equals("")) {
				zhanweiString = zhanweiString + ","
						+ this.cut_tail(h_zhanweiG_C);

			}
			if (!h_zhanweiG_D.equals("")) {
				zhanweiString = zhanweiString + ","
						+ this.cut_tail(h_zhanweiG_D);

			}
			if (!h_zhanweiG_E.equals("")) {
				zhanweiString = zhanweiString + ","
						+ this.cut_tail(h_zhanweiG_E);

			}
			if (!h_zhanweiG_F.equals("")) {
				zhanweiString = zhanweiString + ","
						+ this.cut_tail(h_zhanweiG_F);

			}

			sql = "select * from oc_station where DEL='OFF' AND ID in ("
					+ zhanweiString + ")";
			rs = databaseconn.getStmt().executeQuery(sql);

			xmldate = xmldate + "<categories>";
			tabledata = tabledata + "<tr>" + "<td>" + "属性/站点" + "</td>";// �����ı��ı?
			String link = "";
			while (rs.next()) {
				System.out.println("�Ѿ���ȡ���,��ʼƴ��X��");
				xmldate = xmldate + "<category label='"
						+ rs.getString("STATION_NAME") + "'/>";
				tabledata = tabledata + "<td>" + rs.getString("STATION_NAME")
						+ "</td>";

				link = link + rs.getString("ID") + ",";
			}
			link = this.cut_tail(link);// ͨ����ݿ����վ�������
			xmldate = xmldate + "</categories>";
			tabledata = tabledata + "</tr>";

			List<String> temp_sql_list = new ArrayList<String>();
			h_zhanweiG_A = this.cut_tail(h_zhanweiG_A);
			h_zhanweiG_B = this.cut_tail(h_zhanweiG_B);
			h_zhanweiG_C = this.cut_tail(h_zhanweiG_C);
			h_zhanweiG_D = this.cut_tail(h_zhanweiG_D);
			h_zhanweiG_E = this.cut_tail(h_zhanweiG_E);
			h_zhanweiG_F = this.cut_tail(h_zhanweiG_F);

			temp_sql_list = this.make_sql_list_for_funtionB(h_zhanweiG_A,
					hangciA, depA, P_A, PTOOL_A, MIN_A, MAX_A);
			for (int temp = 0; temp < temp_sql_list.size(); temp++) {
				sql_list.add(temp_sql_list.get(temp));
			}

			temp_sql_list = this.make_sql_list_for_funtionB(h_zhanweiG_B,
					hangciB, depA, P_B, PTOOL_B, MIN_B, MAX_B);
			for (int temp = 0; temp < temp_sql_list.size(); temp++) {
				sql_list.add(temp_sql_list.get(temp));
			}

			temp_sql_list = this.make_sql_list_for_funtionB(h_zhanweiG_C,
					hangciC, depA, P_C, PTOOL_C, MIN_C, MAX_C);
			for (int temp = 0; temp < temp_sql_list.size(); temp++) {
				sql_list.add(temp_sql_list.get(temp));
			}

			temp_sql_list = this.make_sql_list_for_funtionB(h_zhanweiG_D,
					hangciD, depA, P_D, PTOOL_D, MIN_D, MAX_D);
			for (int temp = 0; temp < temp_sql_list.size(); temp++) {
				sql_list.add(temp_sql_list.get(temp));
			}

			temp_sql_list = this.make_sql_list_for_funtionB(h_zhanweiG_E,
					hangciE, depA, P_E, PTOOL_E, MIN_E, MAX_E);
			for (int temp = 0; temp < temp_sql_list.size(); temp++) {
				sql_list.add(temp_sql_list.get(temp));
			}

			temp_sql_list = this.make_sql_list_for_funtionB(h_zhanweiG_F,
					hangciF, depA, P_F, PTOOL_F, MIN_F, MAX_F);
			for (int temp = 0; temp < temp_sql_list.size(); temp++) {
				sql_list.add(temp_sql_list.get(temp));
			}


			for (int s_all = 0; s_all < sql_list.size(); s_all++) {
				System.out.println(sql_list.get(s_all));
				rs = databaseconn.getStmt().executeQuery(sql_list.get(s_all));
				xmldate = xmldate + this.Link_DataDraw_FunctionB_Xml(rs, link);
				tabledata = tabledata
						+ this.Link_DataDraw_FunctionB_Tab(rs, link);
			}

			xmldate = xmldate
					+ "<styles><definition><style name='CanvasAnim' type='animation' param='_xScale' start='0' duration='1' />"
					+ "</definition><application><apply toObject='Canvas' styles='CanvasAnim' /></application></styles></chart>";
			tabledata = tabledata + "</table>";

		} else if (function.equals("C")) {
			System.out.println("ѡ��һ����");
			tabledata = "<table width='100%'><tr><td>**单一属性多层深多层深比较查询**</td></tr>";
			xmldate = "<chart exportEnabled='1' exportAtClient='1' exportHandler='fcExporter1' caption='' **单一站点多层深多属性比较查询**"
					+ " yAxisName='值' showValues='0' numberPrefix='value'>";

			String zhanweiString = "";
			if (!h_zhanweiG_A.equals("")) {
				zhanweiString = zhanweiString + this.cut_tail(h_zhanweiG_A);
			}
			if (!h_zhanweiG_B.equals("")) {
				zhanweiString = zhanweiString + ","
						+ this.cut_tail(h_zhanweiG_B);

			}
			if (!h_zhanweiG_C.equals("")) {
				zhanweiString = zhanweiString + ","
						+ this.cut_tail(h_zhanweiG_C);

			}
			if (!h_zhanweiG_D.equals("")) {
				zhanweiString = zhanweiString + ","
						+ this.cut_tail(h_zhanweiG_D);

			}
			if (!h_zhanweiG_E.equals("")) {
				zhanweiString = zhanweiString + ","
						+ this.cut_tail(h_zhanweiG_E);

			}
			if (!h_zhanweiG_F.equals("")) {
				zhanweiString = zhanweiString + ","
						+ this.cut_tail(h_zhanweiG_F);

			}
			sql = "select * from oc_station where DEL='OFF' AND ID in ("
					+ zhanweiString + ")";
			rs = databaseconn.getStmt().executeQuery(sql);

			xmldate = xmldate + "<categories>";
			tabledata = tabledata + "<tr>" + "<td>" + "站点/层深" + "</td>";// �����ı��ı?
			String link = "";
			while (rs.next()) {
				xmldate = xmldate + "<category label='"
						+ rs.getString("STATION_NAME") + "'/>";
				tabledata = tabledata + "<td>" + rs.getString("STATION_NAME")
						+ "</td>";

				link = link + rs.getString("ID") + ",";
			}
			link = this.cut_tail(link);// ͨ����ݿ����վ�������

			link = this.cut_tail(link);// ͨ����ݿ����վ�������
			xmldate = xmldate + "</categories>";
			tabledata = tabledata + "</tr>";

			List<String> temp_sql_list = new ArrayList<String>();
			h_zhanweiG_A = this.cut_tail(h_zhanweiG_A);
			h_zhanweiG_B = this.cut_tail(h_zhanweiG_B);
			h_zhanweiG_C = this.cut_tail(h_zhanweiG_C);
			h_zhanweiG_D = this.cut_tail(h_zhanweiG_D);
			h_zhanweiG_E = this.cut_tail(h_zhanweiG_E);
			h_zhanweiG_F = this.cut_tail(h_zhanweiG_F);

			temp_sql_list = this.make_sql_list_for_funtionC(h_zhanweiG_A,
					hangciA, depA, P_A, PTOOL_A, MIN_A, MAX_A);
			for (int temp = 0; temp < temp_sql_list.size(); temp++) {
				sql_list.add(temp_sql_list.get(temp));
			}

			temp_sql_list = this.make_sql_list_for_funtionC(h_zhanweiG_B,
					hangciB, depB, P_A, PTOOL_A, MIN_A, MAX_A);
			for (int temp = 0; temp < temp_sql_list.size(); temp++) {
				sql_list.add(temp_sql_list.get(temp));
			}

			temp_sql_list = this.make_sql_list_for_funtionC(h_zhanweiG_C,
					hangciC, depC, P_A, PTOOL_A, MIN_A, MAX_A);
			for (int temp = 0; temp < temp_sql_list.size(); temp++) {
				sql_list.add(temp_sql_list.get(temp));
			}

			temp_sql_list = this.make_sql_list_for_funtionC(h_zhanweiG_D,
					hangciD, depD, P_A, PTOOL_A, MIN_A, MAX_A);
			for (int temp = 0; temp < temp_sql_list.size(); temp++) {
				sql_list.add(temp_sql_list.get(temp));
			}

			temp_sql_list = this.make_sql_list_for_funtionC(h_zhanweiG_E,
					hangciE, depE, P_A, PTOOL_A, MIN_A, MAX_A);
			for (int temp = 0; temp < temp_sql_list.size(); temp++) {
				sql_list.add(temp_sql_list.get(temp));
			}

			temp_sql_list = this.make_sql_list_for_funtionC(h_zhanweiG_F,
					hangciF, depF, P_A, PTOOL_A, MIN_A, MAX_A);
			for (int temp = 0; temp < temp_sql_list.size(); temp++) {
				sql_list.add(temp_sql_list.get(temp));
			}
			System.out.println("sql_list.size()=" + sql_list.size());

			for (int s_all = 0; s_all < sql_list.size(); s_all++) {
				System.out.println(sql_list.get(s_all));
				rs = databaseconn.getStmt().executeQuery(sql_list.get(s_all));
				xmldate = xmldate + this.Link_DataDraw_FunctionC_Xml(rs, link);
				tabledata = tabledata
						+ this.Link_DataDraw_FunctionC_Tab(rs, link);
			}

			xmldate = xmldate
					+ "<styles><definition><style name='CanvasAnim' type='animation' param='_xScale' start='0' duration='1' />"
					+ "</definition><application><apply toObject='Canvas' styles='CanvasAnim' /></application></styles></chart>";
			tabledata = tabledata + "</table>";
		}
		System.out.println("tabledata=" + tabledata);
		System.out.println("xmldate=" + xmldate);
		databaseconn = null;// �ر���ݿ�����
		request.setAttribute("tabledata", tabledata);// �׳��������
		request.setAttribute("xmldate", xmldate);
		return mapping.findForward("success");

		
		
		
	}
	
	
	
	public ActionForward CompareSearchIce(ActionMapping mapping, ActionForm form,
			HttpServletRequest request, HttpServletResponse response)
			throws SQLException {
		CompareSearchForm f = (CompareSearchForm) form;
		String function = f.getFunction();
		String kekaoA = f.getKekaoA();
		String kekaoB = f.getKekaoB();
		String kekaoC = f.getKekaoC();
		String kekaoD = f.getKekaoD();
		String kekaoE = f.getKekaoE();
		String kekaoF = f.getKekaoF();

		String hangciA = f.getHangciA();
		String hangciB = f.getHangciB();
		String hangciC = f.getHangciC();
		String hangciD = f.getHangciD();
		String hangciE = f.getHangciE();
		String hangciF = f.getHangciF();

		String zhanweiA = f.getZhanweiA();
		String zhanweiB = f.getZhanweiB();
		String zhanweiC = f.getZhanweiC();
		String zhanweiD = f.getZhanweiD();
		String zhanweiE = f.getZhanweiD();
		String zhanweiF = f.getZhanweiF();

		String h_zhanweiG_A = f.getH_zhanweiG_A();
		String h_zhanweiG_B = f.getH_zhanweiG_B();
		String h_zhanweiG_C = f.getH_zhanweiG_C();
		String h_zhanweiG_D = f.getH_zhanweiG_D();
		String h_zhanweiG_E = f.getH_zhanweiG_E();
		String h_zhanweiG_F = f.getH_zhanweiG_F();

		String depA = f.getDepA();
		String depB = f.getDepB();
		String depC = f.getDepC();
		String depD = f.getDepD();
		String depE = f.getDepE();
		String depF = f.getDepF();

		String P_A = f.getP_a();
		String PTOOL_A = f.getPTOOL_A();
		String MIN_A = f.getMIN_A();
		String MAX_A = f.getMAX_A();

		String P_B = f.getP_b();
		String PTOOL_B = f.getPTOOL_B();
		String MIN_B = f.getMIN_B();
		String MAX_B = f.getMAX_B();

		String P_C = f.getP_c();
		String PTOOL_C = f.getPTOOL_C();
		String MIN_C = f.getMIN_C();
		String MAX_C = f.getMAX_C();

		String P_D = f.getP_d();
		String PTOOL_D = f.getPTOOL_D();
		String MIN_D = f.getMIN_D();
		String MAX_D = f.getMAX_D();

		String P_E = f.getP_e();
		String PTOOL_E = f.getPTOOL_E();
		String MIN_E = f.getMIN_E();
		String MAX_E = f.getMAX_E();

		String P_F = f.getP_f();
		String PTOOL_F = f.getPTOOL_F();
		String MIN_F = f.getMIN_F();
		String MAX_F = f.getMAX_F();
		String oc_depthlist = depA;
		if (depB != "") {
			oc_depthlist = oc_depthlist + "," + depB;
		}
		if (depC != "") {
			oc_depthlist = oc_depthlist + "," + depC;
		}

		if (depD != "") {
			oc_depthlist = oc_depthlist + "," + depD;
		}
		if (depE != "") {
			oc_depthlist = oc_depthlist + "," + depE;
		}
		if (depF != "") {
			oc_depthlist = oc_depthlist + "," + depF;
		}

		Read_Properties Read_Properties = new Read_Properties(
				"db_cn.properties");
		String ip = Read_Properties.Read_Properties_root("ip");
		String port = Read_Properties.Read_Properties_root("port");
		String service = Read_Properties.Read_Properties_root("servicname");
		String username = Read_Properties.Read_Properties_root("username");
		String password = Read_Properties.Read_Properties_root("password");
		DataBaseConn databaseconn = new DataBaseConn(ip, port, service,
				username, password);
		ResultSet rs = null;
		String sql = "";
		String xmldate = "";
		String tabledata = "";
		List<EnitityBeanOc_Date_Ice> data = new ArrayList<EnitityBeanOc_Date_Ice>();

		List<String> sql_list = new ArrayList<String>();
		Property_Tools_Max_Min p = new Property_Tools_Max_Min();

		if (function.equals("A")) {
			tabledata = "<table width='100%'><tr><td>**单一站点多层深多属性比较查询**</td></tr>";
			xmldate = "<chart exportEnabled='1' exportAtClient='1' exportHandler='fcExporter1' caption='**单一站点多层深多属性比较查询**' xAxisName='层深'"
					+ " yAxisName='值' showValues='0' numberPrefix='value'>";
			EntityBeanOc_Station_Ice e = this.service_search
					.Find_EntityBeanOc_Station_Ice(Integer.valueOf(zhanweiA));
			sql = "select * " + " from OC_DATE_ICE WHERE DEL='OFF' "
					+ " AND OC_VOYAGE_ID=" + hangciA + " AND OC_STATION_ID IN ("
					+ zhanweiA + ")" + " AND OC_DEPLIST_ID IN(" + oc_depthlist
					+ ") " + " AND OC_PROPERTY_ID=" + P_A
					+ " AND OC_PROPERTY_TOOLS_ID=" + PTOOL_A;
			if (MIN_A != "") {
				sql = sql + " AND VALUE_KEY >=" + MIN_A;
			}
			if (MAX_A != "") {
				sql = sql + " AND VALUE_KEY <=" + MAX_A;
			}
			System.out.println("sql=" + sql);
			sql_list.add(sql);
            if(!"-1".endsWith(kekaoB)&& kekaoB!="-1"){
			EntityBeanOc_Station_Ice e2 = this.service_search.Find_Oc_Station_Ice_by_L_D(e.getLongitude(), e
							.getDimensionality(), hangciB);

			if (e2.getId() != null) {
				sql = "select * " + " from OC_DATE_ICE WHERE DEL='OFF' "
						+ "AND OC_VOYAGE_ID=" + hangciB
						+ " AND OC_STATION_ID IN (" + e2.getId() + ")"
						+ " AND OC_DEPLIST_ID IN(" + oc_depthlist + ") "
						+ "AND OC_PROPERTY_ID=" + P_B
						+ " AND OC_PROPERTY_TOOLS_ID=" + PTOOL_B;
				if (MIN_C != "") {
					sql = sql + " AND VALUE_KEY >=" + MIN_B;
				}
				if (MAX_B != "") {
					sql = sql + " AND VALUE_KEY <=" + MAX_B;
				}
				System.out.println("sql=" + sql);
				sql_list.add(sql);
			} else {
				System.out.println("δ�ܷ�����ͬվλ�������ѯ����");
			}
            }
            if(!"-1".endsWith(kekaoC)&& kekaoC!="-1"){
			EntityBeanOc_Station_Ice e3 = this.service_search
					.Find_Oc_Station_Ice_by_L_D(e.getLongitude(), e
							.getDimensionality(), hangciC);
			System.out.println("e3.getId()=" + e3.getId());
			if (e3.getId() != null) {
				
				sql = "select * " + " from OC_DATE_ICE WHERE DEL='OFF' "
						+ "AND OC_VOYAGE_ID=" + hangciC
						+ " AND OC_STATION_ID IN (" + e3.getId() + ")"
						+ " AND OC_DEPLIST_ID IN(" + oc_depthlist + ") "
						+ "AND OC_PROPERTY_ID=" + P_C
						+ " AND OC_PROPERTY_TOOLS_ID=" + PTOOL_C;
				if (MIN_C != "") {
					sql = sql + " AND VALUE_KEY >=" + MIN_C;
				}
				if (MAX_C != "") {
					sql = sql + " AND VALUE_KEY <=" + MAX_C;
				}
				System.out.println("sql=" + sql);
				sql_list.add(sql);

			} else {
				System.out.println("δ�ܷ�����ͬվλ�������ѯ����");
			}
            }
            if(!"-1".endsWith(kekaoD)&& kekaoD!="-1"){
			EntityBeanOc_Station_Ice e4 = this.service_search
					.Find_Oc_Station_Ice_by_L_D(e.getLongitude(), e.getDimensionality(), hangciD);
			System.out.println("e4.getId()=" + e4.getId());
			if (e4.getId() != null) {
				sql = "select * " + " from OC_DATE_ICE WHERE DEL='OFF' "
						+ "AND OC_VOYAGE_ID=" + hangciD
						+ " AND OC_STATION_ID IN (" + e4.getId() + ")"
						+ " AND OC_DEPLIST_ID IN(" + oc_depthlist + ") "
						+ "AND OC_PROPERTY_ID=" + P_D
						+ " AND OC_PROPERTY_TOOLS_ID=" + PTOOL_D;
				if (MIN_D != "") {
					sql = sql + " AND VALUE_KEY >=" + MIN_D;
				}
				if (MAX_D != "") {
					sql = sql + " AND VALUE_KEY <=" + MAX_D;
				}
				System.out.println("sql=" + sql);
				sql_list.add(sql);

			} else {
				System.out.println("δ�ܷ�����ͬվλ�������ѯ����");
			}
            }
            if(!"-1".endsWith(kekaoE)&& kekaoE!="-1"){
			EntityBeanOc_Station_Ice e5 = this.service_search
					.Find_Oc_Station_Ice_by_L_D(e.getLongitude(), e
							.getDimensionality(), hangciE);
			System.out.println("e5.getId()=" + e5.getId());
			if (e5.getId() != null) {
				sql = "select * " + " from OC_DATE_ICE WHERE DEL='OFF' "
						+ "AND OC_VOYAGE_ID=" + hangciE
						+ " AND OC_STATION_ID IN (" + e5.getId() + ")"
						+ " AND OC_DEPLIST_ID IN(" + oc_depthlist + ") "
						+ "AND OC_PROPERTY_ID=" + P_E
						+ " AND OC_PROPERTY_TOOLS_ID=" + PTOOL_E;
				if (MIN_E != "") {
					sql = sql + " AND VALUE_KEY >=" + MIN_E;
				}
				if (MAX_E != "") {
					sql = sql + " AND VALUE_KEY <=" + MAX_E;
				}
				System.out.println("sql=" + sql);
				sql_list.add(sql);
			} else {
				System.out.println("δ�ܷ�����ͬվλ�������ѯ����");
			}
            }
            if(!"-1".endsWith(kekaoF)&& kekaoF!="-1"){
			EntityBeanOc_Station_Ice e6 = this.service_search
					.Find_Oc_Station_Ice_by_L_D(e.getLongitude(), e
							.getDimensionality(), hangciF);
			System.out.println("e6.getId()=" + e6.getId());
			if (e6.getId() != null) {

				sql = "select * " + " from OC_DATE_ICE WHERE DEL='OFF' "
						+ "AND OC_VOYAGE_ID=" + hangciF
						+ " AND OC_STATION_ID IN (" + e6.getId() + ")"
						+ " AND OC_DEPLIST_ID IN(" + oc_depthlist + ") "
						+ "AND OC_PROPERTY_ID=" + P_F
						+ " AND OC_PROPERTY_TOOLS_ID=" + PTOOL_F;
				if (MIN_F != "") {
					sql = sql + " AND VALUE_KEY >=" + MIN_F;
				}
				if (MAX_F != "") {
					sql = sql + " AND VALUE_KEY <=" + MAX_F;
				}
				System.out.println("sql=" + sql);
				sql_list.add(sql);
			} else {
				System.out.println("δ�ܷ�����ͬվλ�������ѯ����");
			}
            }
			sql = "select depth from oc_depthlist_ice where id in (" + oc_depthlist
					+ ") and del='OFF' order by depth";
			try {
				rs = databaseconn.getStmt().executeQuery(sql);
				xmldate = xmldate + "<categories>";
				tabledata = tabledata + "<tr>" + "<td>" + "属性/层深" + "</td>";// �����ı��ı?
				while (rs.next()) {
					xmldate = xmldate + "<category label='"
							+ rs.getString("depth") + "(M)' />";
					tabledata = tabledata + "<td>" + rs.getString("depth")
							+ "(M)" + "</td>";
				}
				xmldate = xmldate + "</categories>";
				tabledata = tabledata + "</tr>";
			} catch (SQLException e1) {

				e1.printStackTrace();
			}

			for (int i = 0; i < sql_list.size(); i++) {
				try {
					rs = databaseconn.getStmt().executeQuery(sql_list.get(i));
					while (rs.next()) { 
						EnitityBeanOc_Date_Ice e1 = new EnitityBeanOc_Date_Ice();
						e1.setDel(rs.getString("DEL"));
						e1.setId(rs.getInt("ID"));
						e1.setOc_deplist_id(rs.getInt("OC_DEPLIST_ID"));
						e1.setOc_property_id(rs.getInt("OC_PROPERTY_ID"));
						e1.setOc_property_tools_id(rs
								.getInt("OC_PROPERTY_TOOLS_ID"));
						e1.setOc_station_id(rs.getInt("OC_STATION_ID"));
						e1.setOc_voyage_id(rs.getInt("OC_VOYAGE_ID"));
						e1.setValue_key(rs.getDouble("VALUE_KEY"));
						data.add(e1);
					}
					if (data.size() > 0) {
						sql = "select PROPERTY_NAME from oc_property_ice where ID="
								+ data.get(0).getOc_property_id();
						rs = databaseconn.getStmt().executeQuery(sql);
						String property_name = "";
						String property_tools = "";
						if (rs.next()) {
							property_name = rs.getString("PROPERTY_NAME");

						}
						sql = "select TOOLS_NAME from oc_property_tools_ice where ID="
								+ data.get(0).getOc_property_tools_id();
						rs = databaseconn.getStmt().executeQuery(sql);
						if (rs.next()) {
							property_tools = rs.getString("TOOLS_NAME");

						}
						xmldate = xmldate + "<dataset seriesName='"
								+ property_name + "(" + property_tools + ")'> ";
						tabledata = tabledata + "<tr><td>" + property_name
								+ "(" + property_tools + ")</td>";

					} else {
						tabledata = tabledata + "<tr><td>" + "null" + "("
								+ "null" + ")</td>";
					}
					String d[] = oc_depthlist.split(",");// ת��ʽ���ַ�����
					List<Integer> dep_list = new ArrayList();
					for (int k = 0; k < d.length; k++)// �Բ�������Ϊ��־������ѯ������
					{
						String AddEmpty = "yes";
						String value = "";
						for (int j = 0; j < data.size(); j++) {
							if (data.get(j).getOc_deplist_id().toString()
									.equals(d[k])) {
								value = data.get(j).getValue_key().toString();
								AddEmpty = "not";
								break;
							}
						}
						if (AddEmpty.endsWith("yes")) {

							xmldate = xmldate + "<set value='" + "'/>";
							tabledata = tabledata + "<td>" + "null" + "</td>";

						} else {

							xmldate = xmldate + "<set value='" + value + "'/>";
							tabledata = tabledata + "<td>" + value + "</td>";

						}

					}
					if (data.size() > 0) {
						xmldate = xmldate + "</dataset>";
						tabledata = tabledata + "</tr>";
						data.clear();
					}

				} catch (SQLException e41) {
					// TODO Auto-generated catch block
					e41.printStackTrace();
				}
			}

			xmldate = xmldate
					+ "<styles><definition><style name='CanvasAnim' type='animation' param='_xScale' start='0' duration='1' />"
					+ "</definition><application><apply toObject='Canvas' styles='CanvasAnim' /></application></styles></chart>";
			tabledata = tabledata + "</table>";

		} else if (function.equals("B")) {
			tabledata = "<table width='100%'><tr><td>**单一属性多层深多层深比较查询**</td></tr>";
			xmldate = "<chart exportEnabled='1' exportAtClient='1' exportHandler='fcExporter1' caption='**单一层深多层深多属性比较查询**'"
					+ " yAxisName='值' showValues='0' numberPrefix='value'>";


			String zhanweiString = "";
			if (!h_zhanweiG_A.equals("")) {
				zhanweiString = zhanweiString + this.cut_tail(h_zhanweiG_A);
			}
			if (!h_zhanweiG_B.equals("")) {
				zhanweiString = zhanweiString + ","
						+ this.cut_tail(h_zhanweiG_B);

			}
			if (!h_zhanweiG_C.equals("")) {
				zhanweiString = zhanweiString + ","
						+ this.cut_tail(h_zhanweiG_C);

			}
			if (!h_zhanweiG_D.equals("")) {
				zhanweiString = zhanweiString + ","
						+ this.cut_tail(h_zhanweiG_D);

			}
			if (!h_zhanweiG_E.equals("")) {
				zhanweiString = zhanweiString + ","
						+ this.cut_tail(h_zhanweiG_E);

			}
			if (!h_zhanweiG_F.equals("")) {
				zhanweiString = zhanweiString + ","
						+ this.cut_tail(h_zhanweiG_F);

			}

			sql = "select * from oc_station_ice where DEL='OFF' AND ID in ("
					+ zhanweiString + ")";
			rs = databaseconn.getStmt().executeQuery(sql);

			xmldate = xmldate + "<categories>";
			tabledata = tabledata + "<tr>" + "<td>" + "属性/站点" + "</td>";// �����ı��ı?
			String link = "";
			while (rs.next()) {
				System.out.println("�Ѿ���ȡ���,��ʼƴ��X��");
				xmldate = xmldate + "<category label='"
						+ rs.getString("STATION_NAME") + "'/>";
				tabledata = tabledata + "<td>" + rs.getString("STATION_NAME")
						+ "</td>";

				link = link + rs.getString("ID") + ",";
			}
			link = this.cut_tail(link);// ͨ����ݿ����վ�������
			xmldate = xmldate + "</categories>";
			tabledata = tabledata + "</tr>";

			List<String> temp_sql_list = new ArrayList<String>();
			h_zhanweiG_A = this.cut_tail(h_zhanweiG_A);
			h_zhanweiG_B = this.cut_tail(h_zhanweiG_B);
			h_zhanweiG_C = this.cut_tail(h_zhanweiG_C);
			h_zhanweiG_D = this.cut_tail(h_zhanweiG_D);
			h_zhanweiG_E = this.cut_tail(h_zhanweiG_E);
			h_zhanweiG_F = this.cut_tail(h_zhanweiG_F);

			temp_sql_list = this.make_sql_list_for_funtionB_ICE(h_zhanweiG_A,
					hangciA, depA, P_A, PTOOL_A, MIN_A, MAX_A);
			  for (int temp = 0; temp < temp_sql_list.size(); temp++) {
				sql_list.add(temp_sql_list.get(temp));
			 }
			if(!"选择航次".endsWith(hangciB)&& !"".endsWith(P_B) && !"".equals("PTOOL_B")){
			   temp_sql_list = this.make_sql_list_for_funtionB_ICE(h_zhanweiG_B,
					hangciB, depA, P_B, PTOOL_B, MIN_B, MAX_B);
			   for (int temp = 0; temp < temp_sql_list.size(); temp++) {
				sql_list.add(temp_sql_list.get(temp));
			    }
			 }
			if(!"选择航次".endsWith(hangciC)&& !"".endsWith(P_C) && !"".equals("PTOOL_C")){
			    temp_sql_list = this.make_sql_list_for_funtionB_ICE(h_zhanweiG_C,
					hangciC, depA, P_C, PTOOL_C, MIN_C, MAX_C);
			    for (int temp = 0; temp < temp_sql_list.size(); temp++) {
				   sql_list.add(temp_sql_list.get(temp));
			    }
			}
			if(!"选择航次".endsWith(hangciD)&& !"".endsWith(P_D) && !"".equals("PTOOL_D")){
			   temp_sql_list = this.make_sql_list_for_funtionB_ICE(h_zhanweiG_D,
					hangciD, depA, P_D, PTOOL_D, MIN_D, MAX_D);
			  for (int temp = 0; temp < temp_sql_list.size(); temp++) {
				sql_list.add(temp_sql_list.get(temp));
			  }
			}
			if(!"选择航次".endsWith(hangciE)&& !"".endsWith(P_E) && !"".equals("PTOOL_E")){
			   temp_sql_list = this.make_sql_list_for_funtionB_ICE(h_zhanweiG_E,
					hangciE, depA, P_E, PTOOL_E, MIN_E, MAX_E);
			   for (int temp = 0; temp < temp_sql_list.size(); temp++) {
				  sql_list.add(temp_sql_list.get(temp));
			   }
			}
			if(!"选择航次".endsWith(hangciF)&& !"".endsWith(P_F) && !"".equals("PTOOL_F")){
			   temp_sql_list = this.make_sql_list_for_funtionB_ICE(h_zhanweiG_F,
					  hangciF, depA, P_F, PTOOL_F, MIN_F, MAX_F);
			   for (int temp = 0; temp < temp_sql_list.size(); temp++) {
			 	  sql_list.add(temp_sql_list.get(temp));
			  }
			}
            
			for (int s_all = 0; s_all < sql_list.size(); s_all++) {
				System.out.println(sql_list.get(s_all));
				rs = databaseconn.getStmt().executeQuery(sql_list.get(s_all));
				  xmldate = xmldate + this.Link_DataDraw_FunctionB_Xml_ICE(rs, link);
				  tabledata = tabledata+ this.Link_DataDraw_FunctionB_Tab_ICE(rs, link);
			}

			xmldate = xmldate
					+ "<styles><definition><style name='CanvasAnim' type='animation' param='_xScale' start='0' duration='1' />"
					+ "</definition><application><apply toObject='Canvas' styles='CanvasAnim' /></application></styles></chart>";
			tabledata = tabledata + "</table>";

		} else if (function.equals("C")) {
			System.out.println("ѡ��һ����");
			tabledata = "<table width='100%'><tr><td>**单一层深多层深多属性比较查询**</td></tr>";
			xmldate = "<chart exportEnabled='1' exportAtClient='1' exportHandler='fcExporter1' caption='**单一层深多层深多属性比较查询**'"
					+ " yAxisName='值' showValues='0' numberPrefix='value'>";

			String zhanweiString = "";
			if (!h_zhanweiG_A.equals("")) {
				zhanweiString = zhanweiString + this.cut_tail(h_zhanweiG_A);
			}
			if (!h_zhanweiG_B.equals("")) {
				zhanweiString = zhanweiString + ","
						+ this.cut_tail(h_zhanweiG_B);

			}
			if (!h_zhanweiG_C.equals("")) {
				zhanweiString = zhanweiString + ","
						+ this.cut_tail(h_zhanweiG_C);

			}
			if (!h_zhanweiG_D.equals("")) {
				zhanweiString = zhanweiString + ","
						+ this.cut_tail(h_zhanweiG_D);

			}
			if (!h_zhanweiG_E.equals("")) {
				zhanweiString = zhanweiString + ","
						+ this.cut_tail(h_zhanweiG_E);

			}
			if (!h_zhanweiG_F.equals("")) {
				zhanweiString = zhanweiString + ","
						+ this.cut_tail(h_zhanweiG_F);

			}
			sql = "select * from oc_station_ice where DEL='OFF' AND ID in ("
					+ zhanweiString + ")";
			rs = databaseconn.getStmt().executeQuery(sql);

			xmldate = xmldate + "<categories>";
			tabledata = tabledata + "<tr>" + "<td>" + "站点/层深" + "</td>";// �����ı��ı?
			String link = "";
			while (rs.next()) {
				xmldate = xmldate + "<category label='"
						+ rs.getString("STATION_NAME") + "'/>";
				tabledata = tabledata + "<td>" + rs.getString("STATION_NAME")
						+ "</td>";

				link = link + rs.getString("ID") + ",";
			}
			link = this.cut_tail(link);// ͨ����ݿ����վ�������

			link = this.cut_tail(link);// ͨ����ݿ����վ�������
			xmldate = xmldate + "</categories>";
			tabledata = tabledata + "</tr>";

			List<String> temp_sql_list = new ArrayList<String>();
			h_zhanweiG_A = this.cut_tail(h_zhanweiG_A);
			h_zhanweiG_B = this.cut_tail(h_zhanweiG_B);
			h_zhanweiG_C = this.cut_tail(h_zhanweiG_C);
			h_zhanweiG_D = this.cut_tail(h_zhanweiG_D);
			h_zhanweiG_E = this.cut_tail(h_zhanweiG_E);
			h_zhanweiG_F = this.cut_tail(h_zhanweiG_F);

			temp_sql_list = this.make_sql_list_for_funtionC_ICE(h_zhanweiG_A,
					hangciA, depA, P_A, PTOOL_A, MIN_A, MAX_A);
			for (int temp = 0; temp < temp_sql_list.size(); temp++) {
				sql_list.add(temp_sql_list.get(temp));
			}
			if(!"选择航次".endsWith(hangciB)&& !"".endsWith(depB)){
			temp_sql_list = this.make_sql_list_for_funtionC_ICE(h_zhanweiG_B,
					hangciB, depB, P_A, PTOOL_A, MIN_A, MAX_A);
			for (int temp = 0; temp < temp_sql_list.size(); temp++) {
				sql_list.add(temp_sql_list.get(temp));
			}
			}
			if(!"选择航次".endsWith(hangciC)&& !"".endsWith(depC) ){
			temp_sql_list = this.make_sql_list_for_funtionC_ICE(h_zhanweiG_C,
					hangciC, depC, P_A, PTOOL_A, MIN_A, MAX_A);
			for (int temp = 0; temp < temp_sql_list.size(); temp++) {
				sql_list.add(temp_sql_list.get(temp));
			}
			}
			if(!"选择航次".endsWith(hangciD)&& !"".endsWith(depD)){
			temp_sql_list = this.make_sql_list_for_funtionC_ICE(h_zhanweiG_D,
					hangciD, depD, P_A, PTOOL_A, MIN_A, MAX_A);
			for (int temp = 0; temp < temp_sql_list.size(); temp++) {
				sql_list.add(temp_sql_list.get(temp));
			}
			}
			if(!"选择航次".endsWith(hangciE)&& !"".endsWith(depE)){
			temp_sql_list = this.make_sql_list_for_funtionC_ICE(h_zhanweiG_E,
					hangciE, depE, P_A, PTOOL_A, MIN_A, MAX_A);
			for (int temp = 0; temp < temp_sql_list.size(); temp++) {
				sql_list.add(temp_sql_list.get(temp));
			}
			}
			if(!"选择航次".endsWith(hangciF)&& !"".endsWith(depF)){
			temp_sql_list = this.make_sql_list_for_funtionC_ICE(h_zhanweiG_F,
					hangciF, depF, P_A, PTOOL_A, MIN_A, MAX_A);
			for (int temp = 0; temp < temp_sql_list.size(); temp++) {
				sql_list.add(temp_sql_list.get(temp));
			}
			}

			for (int s_all = 0; s_all < sql_list.size(); s_all++) {
				System.out.println(sql_list.get(s_all));
				rs = databaseconn.getStmt().executeQuery(sql_list.get(s_all));
				xmldate = xmldate + this.Link_DataDraw_FunctionC_Xml_Ice(rs, link);
				tabledata = tabledata
						+ this.Link_DataDraw_FunctionC_Tab_ICE(rs, link);
			}

			xmldate = xmldate
					+ "<styles><definition><style name='CanvasAnim' type='animation' param='_xScale' start='0' duration='1' />"
					+ "</definition><application><apply toObject='Canvas' styles='CanvasAnim' /></application></styles></chart>";
			tabledata = tabledata + "</table>";
		}
		System.out.println("tabledata=" + tabledata);
		System.out.println("xmldate=" + xmldate);
		databaseconn = null;// �ر���ݿ�����
		request.setAttribute("tabledata", tabledata);// �׳��������
		request.setAttribute("xmldate", xmldate);
		return mapping.findForward("success");

	}

	public ActionForward CompareSearch_Pla(ActionMapping mapping, ActionForm form,
			HttpServletRequest request, HttpServletResponse response)
			throws SQLException {
		CompareSearchForm f = (CompareSearchForm) form;
		String function = f.getFunction();
		String kekaoA = f.getKekaoA();
		String kekaoB = f.getKekaoB();
		String kekaoC = f.getKekaoC();
		String kekaoD = f.getKekaoD();
		String kekaoE = f.getKekaoE();
		String kekaoF = f.getKekaoF();

		String hangciA = f.getHangciA();
		String hangciB = f.getHangciB();
		String hangciC = f.getHangciC();
		String hangciD = f.getHangciD();
		String hangciE = f.getHangciE();
		String hangciF = f.getHangciF();

		String zhanweiA = f.getZhanweiA();
		String zhanweiB = f.getZhanweiB();
		String zhanweiC = f.getZhanweiC();
		String zhanweiD = f.getZhanweiD();
		String zhanweiE = f.getZhanweiD();
		String zhanweiF = f.getZhanweiF();

		String h_zhanweiG_A = f.getH_zhanweiG_A();
		String h_zhanweiG_B = f.getH_zhanweiG_B();
		String h_zhanweiG_C = f.getH_zhanweiG_C();
		String h_zhanweiG_D = f.getH_zhanweiG_D();
		String h_zhanweiG_E = f.getH_zhanweiG_E();
		String h_zhanweiG_F = f.getH_zhanweiG_F();

		String depA = f.getDepA();
		String depB = f.getDepB();
		String depC = f.getDepC();
		String depD = f.getDepD();
		String depE = f.getDepE();
		String depF = f.getDepF();

		String P_A = f.getP_a();
		String PTOOL_A = f.getPTOOL_A();
		String MIN_A = f.getMIN_A();
		String MAX_A = f.getMAX_A();

		String P_B = f.getP_b();
		String PTOOL_B = f.getPTOOL_B();
		String MIN_B = f.getMIN_B();
		String MAX_B = f.getMAX_B();

		String P_C = f.getP_c();
		String PTOOL_C = f.getPTOOL_C();
		String MIN_C = f.getMIN_C();
		String MAX_C = f.getMAX_C();

		String P_D = f.getP_d();
		String PTOOL_D = f.getPTOOL_D();
		String MIN_D = f.getMIN_D();
		String MAX_D = f.getMAX_D();

		String P_E = f.getP_e();
		String PTOOL_E = f.getPTOOL_E();
		String MIN_E = f.getMIN_E();
		String MAX_E = f.getMAX_E();

		String P_F = f.getP_f();
		String PTOOL_F = f.getPTOOL_F();
		String MIN_F = f.getMIN_F();
		String MAX_F = f.getMAX_F();
		String oc_depthlist = depA;
		if (depB != "") {
			oc_depthlist = oc_depthlist + "," + depB;
		}
		if (depC != "") {
			oc_depthlist = oc_depthlist + "," + depC;
		}

		if (depD != "") {
			oc_depthlist = oc_depthlist + "," + depD;
		}
		if (depE != "") {
			oc_depthlist = oc_depthlist + "," + depE;
		}
		if (depF != "") {
			oc_depthlist = oc_depthlist + "," + depF;
		}

		Read_Properties Read_Properties = new Read_Properties(
				"db_cn.properties");
		String ip = Read_Properties.Read_Properties_root("ip");
		String port = Read_Properties.Read_Properties_root("port");
		String service = Read_Properties.Read_Properties_root("servicname");
		String username = Read_Properties.Read_Properties_root("username");
		String password = Read_Properties.Read_Properties_root("password");
		DataBaseConn databaseconn = new DataBaseConn(ip, port, service,
				username, password);
		ResultSet rs = null;
		String sql = "";
		String xmldate = "";
		String tabledata = "";
		List<EnitityBeanOc_Date_Pla> data = new ArrayList<EnitityBeanOc_Date_Pla>();

		List<String> sql_list = new ArrayList<String>();
		Property_Tools_Max_Min p = new Property_Tools_Max_Min();

		if (function.equals("A")) {
			tabledata = "<table width='100%'><tr><td>**单一站点多层深多属性比较查询**</td></tr>";
			xmldate = "<chart exportEnabled='1' exportAtClient='1' exportHandler='fcExporter1' caption='**单一站点多层深多属性比较查询**' xAxisName='层深'"
					+ " yAxisName='值' showValues='0' numberPrefix='value'>";
			EntityBeanOc_Station_Pla e = this.service_search
					.Find_EntityBeanOc_Station_Pla(Integer.valueOf(zhanweiA));
			sql = "select * " + " from OC_DATE_PLA WHERE DEL='OFF' "
					+ " AND OC_VOYAGE_ID=" + hangciA + " AND OC_STATION_ID IN ("
					+ zhanweiA + ")" + " AND OC_DEPLIST_ID IN(" + oc_depthlist
					+ ") " + " AND OC_PROPERTY_ID=" + P_A
					+ " AND OC_PROPERTY_TOOLS_ID=" + PTOOL_A;
			if (MIN_A != "") {
				sql = sql + " AND VALUE_KEY >=" + MIN_A;
			}
			if (MAX_A != "") {
				sql = sql + " AND VALUE_KEY <=" + MAX_A;
			}
			System.out.println("sql=" + sql);
			sql_list.add(sql);
            if(!"-1".endsWith(kekaoB)&& kekaoB!="-1"){
			EntityBeanOc_Station_Pla e2 = this.service_search.Find_Oc_Station_Pla_by_L_D(e.getLongitude(), e
							.getDimensionality(), hangciB);

			if (e2.getId() != null) {
				sql = "select * " + " from OC_DATE_PLA WHERE DEL='OFF' "
						+ "AND OC_VOYAGE_ID=" + hangciB
						+ " AND OC_STATION_ID IN (" + e2.getId() + ")"
						+ " AND OC_DEPLIST_ID IN(" + oc_depthlist + ") "
						+ "AND OC_PROPERTY_ID=" + P_B
						+ " AND OC_PROPERTY_TOOLS_ID=" + PTOOL_B;
				if (MIN_C != "") {
					sql = sql + " AND VALUE_KEY >=" + MIN_B;
				}
				if (MAX_B != "") {
					sql = sql + " AND VALUE_KEY <=" + MAX_B;
				}
				System.out.println("sql=" + sql);
				sql_list.add(sql);
			} else {
				System.out.println("δ�ܷ�����ͬվλ�������ѯ����");
			}
            }
            if(!"-1".endsWith(kekaoC)&& kekaoC!="-1"){
            	EntityBeanOc_Station_Pla e3 = this.service_search
					.Find_Oc_Station_Pla_by_L_D(e.getLongitude(), e
							.getDimensionality(), hangciC);
			System.out.println("e3.getId()=" + e3.getId());
			if (e3.getId() != null) {
				
				sql = "select * " + " from OC_DATE_PLA WHERE DEL='OFF' "
						+ "AND OC_VOYAGE_ID=" + hangciC
						+ " AND OC_STATION_ID IN (" + e3.getId() + ")"
						+ " AND OC_DEPLIST_ID IN(" + oc_depthlist + ") "
						+ "AND OC_PROPERTY_ID=" + P_C
						+ " AND OC_PROPERTY_TOOLS_ID=" + PTOOL_C;
				if (MIN_C != "") {
					sql = sql + " AND VALUE_KEY >=" + MIN_C;
				}
				if (MAX_C != "") {
					sql = sql + " AND VALUE_KEY <=" + MAX_C;
				}
				System.out.println("sql=" + sql);
				sql_list.add(sql);

			} else {
				System.out.println("δ�ܷ�����ͬվλ�������ѯ����");
			}
            }
            if(!"-1".endsWith(kekaoD)&& kekaoD!="-1"){
			EntityBeanOc_Station_Pla e4 = this.service_search
					.Find_Oc_Station_Pla_by_L_D(e.getLongitude(), e.getDimensionality(), hangciD);
			System.out.println("e4.getId()=" + e4.getId());
			if (e4.getId() != null) {
				sql = "select * " + " from OC_DATE_PLA WHERE DEL='OFF' "
						+ "AND OC_VOYAGE_ID=" + hangciD
						+ " AND OC_STATION_ID IN (" + e4.getId() + ")"
						+ " AND OC_DEPLIST_ID IN(" + oc_depthlist + ") "
						+ "AND OC_PROPERTY_ID=" + P_D
						+ " AND OC_PROPERTY_TOOLS_ID=" + PTOOL_D;
				if (MIN_D != "") {
					sql = sql + " AND VALUE_KEY >=" + MIN_D;
				}
				if (MAX_D != "") {
					sql = sql + " AND VALUE_KEY <=" + MAX_D;
				}
				System.out.println("sql=" + sql);
				sql_list.add(sql);

			} else {
				System.out.println("δ�ܷ�����ͬվλ�������ѯ����");
			}
            }
            if(!"-1".endsWith(kekaoE)&& kekaoE!="-1"){
			EntityBeanOc_Station_Pla e5 = this.service_search
					.Find_Oc_Station_Pla_by_L_D(e.getLongitude(), e
							.getDimensionality(), hangciE);
			System.out.println("e5.getId()=" + e5.getId());
			if (e5.getId() != null) {
				sql = "select * " + " from OC_DATE_PLA WHERE DEL='OFF' "
						+ "AND OC_VOYAGE_ID=" + hangciE
						+ " AND OC_STATION_ID IN (" + e5.getId() + ")"
						+ " AND OC_DEPLIST_ID IN(" + oc_depthlist + ") "
						+ "AND OC_PROPERTY_ID=" + P_E
						+ " AND OC_PROPERTY_TOOLS_ID=" + PTOOL_E;
				if (MIN_E != "") {
					sql = sql + " AND VALUE_KEY >=" + MIN_E;
				}
				if (MAX_E != "") {
					sql = sql + " AND VALUE_KEY <=" + MAX_E;
				}
				System.out.println("sql=" + sql);
				sql_list.add(sql);
			} else {
				System.out.println("δ�ܷ�����ͬվλ�������ѯ����");
			}
            }
            if(!"-1".endsWith(kekaoF)&& kekaoF!="-1"){
			EntityBeanOc_Station_Pla e6 = this.service_search
					.Find_Oc_Station_Pla_by_L_D(e.getLongitude(), e
							.getDimensionality(), hangciF);
			System.out.println("e6.getId()=" + e6.getId());
			if (e6.getId() != null) {

				sql = "select * " + " from OC_DATE_Pla WHERE DEL='OFF' "
						+ "AND OC_VOYAGE_ID=" + hangciF
						+ " AND OC_STATION_ID IN (" + e6.getId() + ")"
						+ " AND OC_DEPLIST_ID IN(" + oc_depthlist + ") "
						+ "AND OC_PROPERTY_ID=" + P_F
						+ " AND OC_PROPERTY_TOOLS_ID=" + PTOOL_F;
				if (MIN_F != "") {
					sql = sql + " AND VALUE_KEY >=" + MIN_F;
				}
				if (MAX_F != "") {
					sql = sql + " AND VALUE_KEY <=" + MAX_F;
				}
				System.out.println("sql=" + sql);
				sql_list.add(sql);
			} else {
				System.out.println("δ�ܷ�����ͬվλ�������ѯ����");
			}
            }
			sql = "select depth from oc_depthlist_pla where id in (" + oc_depthlist
					+ ") and del='OFF' order by depth";
			try {
				rs = databaseconn.getStmt().executeQuery(sql);
				xmldate = xmldate + "<categories>";
				tabledata = tabledata + "<tr>" + "<td>" + "属性/层深" + "</td>";// �����ı��ı?
				while (rs.next()) {
					xmldate = xmldate + "<category label='"
							+ rs.getString("depth") + "(M)' />";
					tabledata = tabledata + "<td>" + rs.getString("depth")
							+ "(M)" + "</td>";
				}
				xmldate = xmldate + "</categories>";
				tabledata = tabledata + "</tr>";
			} catch (SQLException e1) {

				e1.printStackTrace();
			}

			for (int i = 0; i < sql_list.size(); i++) {
				try {
					rs = databaseconn.getStmt().executeQuery(sql_list.get(i));
					while (rs.next()) { 
						EnitityBeanOc_Date_Pla e1 = new EnitityBeanOc_Date_Pla();
						e1.setDel(rs.getString("DEL"));
						e1.setId(rs.getInt("ID"));
						e1.setOc_deplist_id(rs.getInt("OC_DEPLIST_ID"));
						e1.setOc_property_id(rs.getInt("OC_PROPERTY_ID"));
						e1.setOc_property_tools_id(rs
								.getInt("OC_PROPERTY_TOOLS_ID"));
						e1.setOc_station_id(rs.getInt("OC_STATION_ID"));
						e1.setOc_voyage_id(rs.getInt("OC_VOYAGE_ID"));
						e1.setValue_key(rs.getDouble("VALUE_KEY"));
						data.add(e1);
					}
					if (data.size() > 0) {
						sql = "select PROPERTY_NAME from oc_property_pla where ID="
								+ data.get(0).getOc_property_id();
						rs = databaseconn.getStmt().executeQuery(sql);
						String property_name = "";
						String property_tools = "";
						if (rs.next()) {
							property_name = rs.getString("PROPERTY_NAME");

						}
						sql = "select TOOLS_NAME from oc_property_tools_pla where ID="
								+ data.get(0).getOc_property_tools_id();
						rs = databaseconn.getStmt().executeQuery(sql);
						if (rs.next()) {
							property_tools = rs.getString("TOOLS_NAME");

						}
						xmldate = xmldate + "<dataset seriesName='"
								+ property_name + "(" + property_tools + ")'> ";
						tabledata = tabledata + "<tr><td>" + property_name
								+ "(" + property_tools + ")</td>";

					} else {
						tabledata = tabledata + "<tr><td>" + "null" + "("
								+ "null" + ")</td>";
					}
					String d[] = oc_depthlist.split(",");// ת��ʽ���ַ�����
					List<Integer> dep_list = new ArrayList();
					for (int k = 0; k < d.length; k++)// �Բ�������Ϊ��־������ѯ������
					{
						String AddEmpty = "yes";
						String value = "";
						for (int j = 0; j < data.size(); j++) {
							if (data.get(j).getOc_deplist_id().toString()
									.equals(d[k])) {
								value = data.get(j).getValue_key().toString();
								AddEmpty = "not";
								break;
							}
						}
						if (AddEmpty.endsWith("yes")) {

							xmldate = xmldate + "<set value='" + "'/>";
							tabledata = tabledata + "<td>" + "null" + "</td>";

						} else {

							xmldate = xmldate + "<set value='" + value + "'/>";
							tabledata = tabledata + "<td>" + value + "</td>";

						}

					}
					if (data.size() > 0) {
						xmldate = xmldate + "</dataset>";
						tabledata = tabledata + "</tr>";
						data.clear();
					}

				} catch (SQLException e41) {
					// TODO Auto-generated catch block
					e41.printStackTrace();
				}
			}

			xmldate = xmldate
					+ "<styles><definition><style name='CanvasAnim' type='animation' param='_xScale' start='0' duration='1' />"
					+ "</definition><application><apply toObject='Canvas' styles='CanvasAnim' /></application></styles></chart>";
			tabledata = tabledata + "</table>";

		} else if (function.equals("B")) {
			tabledata = "<table width='100%'><tr><td>**单一层深多层深多属性比较查询**</td></tr>";
			xmldate = "<chart exportEnabled='1' exportAtClient='1' exportHandler='fcExporter1' caption='**单一层深多层深多属性比较查询**'"
					+ " yAxisName='值' showValues='0' numberPrefix='value'>";


			String zhanweiString = "";
			if (!h_zhanweiG_A.equals("")) {
				zhanweiString = zhanweiString + this.cut_tail(h_zhanweiG_A);
			}
			if (!h_zhanweiG_B.equals("")) {
				zhanweiString = zhanweiString + ","
						+ this.cut_tail(h_zhanweiG_B);

			}
			if (!h_zhanweiG_C.equals("")) {
				zhanweiString = zhanweiString + ","
						+ this.cut_tail(h_zhanweiG_C);

			}
			if (!h_zhanweiG_D.equals("")) {
				zhanweiString = zhanweiString + ","
						+ this.cut_tail(h_zhanweiG_D);

			}
			if (!h_zhanweiG_E.equals("")) {
				zhanweiString = zhanweiString + ","
						+ this.cut_tail(h_zhanweiG_E);

			}
			if (!h_zhanweiG_F.equals("")) {
				zhanweiString = zhanweiString + ","
						+ this.cut_tail(h_zhanweiG_F);

			}

			sql = "select * from oc_station_pla where DEL='OFF' AND ID in ("
					+ zhanweiString + ")";
			rs = databaseconn.getStmt().executeQuery(sql);

			xmldate = xmldate + "<categories>";
			tabledata = tabledata + "<tr>" + "<td>" + "属性/站点" + "</td>";// �����ı��ı?
			String link = "";
			while (rs.next()) {
				System.out.println("�Ѿ���ȡ���,��ʼƴ��X��");
				xmldate = xmldate + "<category label='"
						+ rs.getString("STATION_NAME") + "'/>";
				tabledata = tabledata + "<td>" + rs.getString("STATION_NAME")
						+ "</td>";

				link = link + rs.getString("ID") + ",";
			}
			link = this.cut_tail(link);// ͨ����ݿ����վ�������
			xmldate = xmldate + "</categories>";
			tabledata = tabledata + "</tr>";

			List<String> temp_sql_list = new ArrayList<String>();
			h_zhanweiG_A = this.cut_tail(h_zhanweiG_A);
			h_zhanweiG_B = this.cut_tail(h_zhanweiG_B);
			h_zhanweiG_C = this.cut_tail(h_zhanweiG_C);
			h_zhanweiG_D = this.cut_tail(h_zhanweiG_D);
			h_zhanweiG_E = this.cut_tail(h_zhanweiG_E);
			h_zhanweiG_F = this.cut_tail(h_zhanweiG_F);

			temp_sql_list = this.make_sql_list_for_funtionB_Pla(h_zhanweiG_A,
					hangciA, depA, P_A, PTOOL_A, MIN_A, MAX_A);
			for (int temp = 0; temp < temp_sql_list.size(); temp++) {
				sql_list.add(temp_sql_list.get(temp));
			}

			temp_sql_list = this.make_sql_list_for_funtionB_Pla(h_zhanweiG_B,
					hangciB, depA, P_B, PTOOL_B, MIN_B, MAX_B);
			for (int temp = 0; temp < temp_sql_list.size(); temp++) {
				sql_list.add(temp_sql_list.get(temp));
			}

			temp_sql_list = this.make_sql_list_for_funtionB_Pla(h_zhanweiG_C,
					hangciC, depA, P_C, PTOOL_C, MIN_C, MAX_C);
			for (int temp = 0; temp < temp_sql_list.size(); temp++) {
				sql_list.add(temp_sql_list.get(temp));
			}

			temp_sql_list = this.make_sql_list_for_funtionB_Pla(h_zhanweiG_D,
					hangciD, depA, P_D, PTOOL_D, MIN_D, MAX_D);
			for (int temp = 0; temp < temp_sql_list.size(); temp++) {
				sql_list.add(temp_sql_list.get(temp));
			}

			temp_sql_list = this.make_sql_list_for_funtionB_Pla(h_zhanweiG_E,
					hangciE, depA, P_E, PTOOL_E, MIN_E, MAX_E);
			for (int temp = 0; temp < temp_sql_list.size(); temp++) {
				sql_list.add(temp_sql_list.get(temp));
			}

			temp_sql_list = this.make_sql_list_for_funtionB_Pla(h_zhanweiG_F,
					hangciF, depA, P_F, PTOOL_F, MIN_F, MAX_F);
			for (int temp = 0; temp < temp_sql_list.size(); temp++) {
				sql_list.add(temp_sql_list.get(temp));
			}


			for (int s_all = 0; s_all < sql_list.size(); s_all++) {
				System.out.println(sql_list.get(s_all));
				rs = databaseconn.getStmt().executeQuery(sql_list.get(s_all));
				xmldate = xmldate + this.Link_DataDraw_FunctionB_Xml_Pla(rs, link);
				tabledata = tabledata
						+ this.Link_DataDraw_FunctionB_Tab_Pla(rs, link);
			}

			xmldate = xmldate
					+ "<styles><definition><style name='CanvasAnim' type='animation' param='_xScale' start='0' duration='1' />"
					+ "</definition><application><apply toObject='Canvas' styles='CanvasAnim' /></application></styles></chart>";
			tabledata = tabledata + "</table>";

		} else if (function.equals("C")) {
			System.out.println("ѡ��һ����");
			tabledata = "<table width='100%'><tr><td>**单一层深多层深多属性比较查询**</td></tr>";
			xmldate = "<chart exportEnabled='1' exportAtClient='1' exportHandler='fcExporter1' caption='**单一层深多层深多属性比较查询**'"
					+ " yAxisName='值' showValues='0' numberPrefix='value'>";

			String zhanweiString = "";
			if (!h_zhanweiG_A.equals("")) {
				zhanweiString = zhanweiString + this.cut_tail(h_zhanweiG_A);
			}
			if (!h_zhanweiG_B.equals("")) {
				zhanweiString = zhanweiString + ","
						+ this.cut_tail(h_zhanweiG_B);

			}
			if (!h_zhanweiG_C.equals("")) {
				zhanweiString = zhanweiString + ","
						+ this.cut_tail(h_zhanweiG_C);

			}
			if (!h_zhanweiG_D.equals("")) {
				zhanweiString = zhanweiString + ","
						+ this.cut_tail(h_zhanweiG_D);

			}
			if (!h_zhanweiG_E.equals("")) {
				zhanweiString = zhanweiString + ","
						+ this.cut_tail(h_zhanweiG_E);

			}
			if (!h_zhanweiG_F.equals("")) {
				zhanweiString = zhanweiString + ","
						+ this.cut_tail(h_zhanweiG_F);

			}
			sql = "select * from oc_station_pla where DEL='OFF' AND ID in ("
					+ zhanweiString + ")";
			rs = databaseconn.getStmt().executeQuery(sql);

			xmldate = xmldate + "<categories>";
			tabledata = tabledata + "<tr>" + "<td>" + "站点/层深" + "</td>";// �����ı��ı?
			String link = "";
			while (rs.next()) {
				xmldate = xmldate + "<category label='"
						+ rs.getString("STATION_NAME") + "'/>";
				tabledata = tabledata + "<td>" + rs.getString("STATION_NAME")
						+ "</td>";

				link = link + rs.getString("ID") + ",";
			}
			link = this.cut_tail(link);// ͨ����ݿ����վ�������

			link = this.cut_tail(link);// ͨ����ݿ����վ�������
			xmldate = xmldate + "</categories>";
			tabledata = tabledata + "</tr>";

			List<String> temp_sql_list = new ArrayList<String>();
			h_zhanweiG_A = this.cut_tail(h_zhanweiG_A);
			h_zhanweiG_B = this.cut_tail(h_zhanweiG_B);
			h_zhanweiG_C = this.cut_tail(h_zhanweiG_C);
			h_zhanweiG_D = this.cut_tail(h_zhanweiG_D);
			h_zhanweiG_E = this.cut_tail(h_zhanweiG_E);
			h_zhanweiG_F = this.cut_tail(h_zhanweiG_F);

			temp_sql_list = this.make_sql_list_for_funtionC_Pla(h_zhanweiG_A,
					hangciA, depA, P_A, PTOOL_A, MIN_A, MAX_A);
			for (int temp = 0; temp < temp_sql_list.size(); temp++) {
				sql_list.add(temp_sql_list.get(temp));
			}

			temp_sql_list = this.make_sql_list_for_funtionC_Pla(h_zhanweiG_B,
					hangciB, depB, P_A, PTOOL_A, MIN_A, MAX_A);
			for (int temp = 0; temp < temp_sql_list.size(); temp++) {
				sql_list.add(temp_sql_list.get(temp));
			}

			temp_sql_list = this.make_sql_list_for_funtionC_Pla(h_zhanweiG_C,
					hangciC, depC, P_A, PTOOL_A, MIN_A, MAX_A);
			for (int temp = 0; temp < temp_sql_list.size(); temp++) {
				sql_list.add(temp_sql_list.get(temp));
			}

			temp_sql_list = this.make_sql_list_for_funtionC_Pla(h_zhanweiG_D,
					hangciD, depD, P_A, PTOOL_A, MIN_A, MAX_A);
			for (int temp = 0; temp < temp_sql_list.size(); temp++) {
				sql_list.add(temp_sql_list.get(temp));
			}

			temp_sql_list = this.make_sql_list_for_funtionC_Pla(h_zhanweiG_E,
					hangciE, depE, P_A, PTOOL_A, MIN_A, MAX_A);
			for (int temp = 0; temp < temp_sql_list.size(); temp++) {
				sql_list.add(temp_sql_list.get(temp));
			}

			temp_sql_list = this.make_sql_list_for_funtionC_Pla(h_zhanweiG_F,
					hangciF, depF, P_A, PTOOL_A, MIN_A, MAX_A);
			for (int temp = 0; temp < temp_sql_list.size(); temp++) {
				sql_list.add(temp_sql_list.get(temp));
			}
			System.out.println("sql_list.size()=" + sql_list.size());

			for (int s_all = 0; s_all < sql_list.size(); s_all++) {
				System.out.println(sql_list.get(s_all));
				rs = databaseconn.getStmt().executeQuery(sql_list.get(s_all));
				xmldate = xmldate + this.Link_DataDraw_FunctionC_Xml_Pla(rs, link);
				tabledata = tabledata
						+ this.Link_DataDraw_FunctionC_Tab_Pla(rs, link);
			}

			xmldate = xmldate
					+ "<styles><definition><style name='CanvasAnim' type='animation' param='_xScale' start='0' duration='1' />"
					+ "</definition><application><apply toObject='Canvas' styles='CanvasAnim' /></application></styles></chart>";
			tabledata = tabledata + "</table>";
		}
		System.out.println("tabledata=" + tabledata);
		System.out.println("xmldate=" + xmldate);
		databaseconn = null;
		request.setAttribute("tabledata", tabledata);
		request.setAttribute("xmldate", xmldate);
		return mapping.findForward("success");

	}
	public ActionForward CompareSearch_Ben(ActionMapping mapping, ActionForm form,
			HttpServletRequest request, HttpServletResponse response)
			throws SQLException {
		CompareSearchForm f = (CompareSearchForm) form;
		String function = f.getFunction();
		String kekaoA = f.getKekaoA();
		String kekaoB = f.getKekaoB();
		String kekaoC = f.getKekaoC();
		String kekaoD = f.getKekaoD();
		String kekaoE = f.getKekaoE();
		String kekaoF = f.getKekaoF();

		String hangciA = f.getHangciA();
		String hangciB = f.getHangciB();
		String hangciC = f.getHangciC();
		String hangciD = f.getHangciD();
		String hangciE = f.getHangciE();
		String hangciF = f.getHangciF();

		String zhanweiA = f.getZhanweiA();
		String zhanweiB = f.getZhanweiB();
		String zhanweiC = f.getZhanweiC();
		String zhanweiD = f.getZhanweiD();
		String zhanweiE = f.getZhanweiD();
		String zhanweiF = f.getZhanweiF();

		String h_zhanweiG_A = f.getH_zhanweiG_A();
		String h_zhanweiG_B = f.getH_zhanweiG_B();
		String h_zhanweiG_C = f.getH_zhanweiG_C();
		String h_zhanweiG_D = f.getH_zhanweiG_D();
		String h_zhanweiG_E = f.getH_zhanweiG_E();
		String h_zhanweiG_F = f.getH_zhanweiG_F();

		String depA = f.getDepA();
		String depB = f.getDepB();
		String depC = f.getDepC();
		String depD = f.getDepD();
		String depE = f.getDepE();
		String depF = f.getDepF();

		String P_A = f.getP_a();
		String PTOOL_A = f.getPTOOL_A();
		String MIN_A = f.getMIN_A();
		String MAX_A = f.getMAX_A();

		String P_B = f.getP_b();
		String PTOOL_B = f.getPTOOL_B();
		String MIN_B = f.getMIN_B();
		String MAX_B = f.getMAX_B();

		String P_C = f.getP_c();
		String PTOOL_C = f.getPTOOL_C();
		String MIN_C = f.getMIN_C();
		String MAX_C = f.getMAX_C();

		String P_D = f.getP_d();
		String PTOOL_D = f.getPTOOL_D();
		String MIN_D = f.getMIN_D();
		String MAX_D = f.getMAX_D();

		String P_E = f.getP_e();
		String PTOOL_E = f.getPTOOL_E();
		String MIN_E = f.getMIN_E();
		String MAX_E = f.getMAX_E();

		String P_F = f.getP_f();
		String PTOOL_F = f.getPTOOL_F();
		String MIN_F = f.getMIN_F();
		String MAX_F = f.getMAX_F();
		String oc_depthlist = depA;
		if (depB != "") {
			oc_depthlist = oc_depthlist + "," + depB;
		}
		if (depC != "") {
			oc_depthlist = oc_depthlist + "," + depC;
		}

		if (depD != "") {
			oc_depthlist = oc_depthlist + "," + depD;
		}
		if (depE != "") {
			oc_depthlist = oc_depthlist + "," + depE;
		}
		if (depF != "") {
			oc_depthlist = oc_depthlist + "," + depF;
		}

		Read_Properties Read_Properties = new Read_Properties(
				"db_cn.properties");
		String ip = Read_Properties.Read_Properties_root("ip");
		String port = Read_Properties.Read_Properties_root("port");
		String service = Read_Properties.Read_Properties_root("servicname");
		String username = Read_Properties.Read_Properties_root("username");
		String password = Read_Properties.Read_Properties_root("password");
		DataBaseConn databaseconn = new DataBaseConn(ip, port, service,
				username, password);
		ResultSet rs = null;
		String sql = "";
		String xmldate = "";
		String tabledata = "";
		List<EnitityBeanOc_Date_Ben> data = new ArrayList<EnitityBeanOc_Date_Ben>();

		List<String> sql_list = new ArrayList<String>();
		Property_Tools_Max_Min p = new Property_Tools_Max_Min();

		if (function.equals("A")) {
			tabledata = "<table width='100%'><tr><td>**单一站点多层深多属性比较查询**</td></tr>";
			xmldate = "<chart exportEnabled='1' exportAtClient='1' exportHandler='fcExporter1' caption='**单一站点多层深多属性比较查询**' xAxisName='层深'"
					+ " yAxisName='值' showValues='0' numberPrefix='value'>";
			EntityBeanOc_Station_Ben e = this.service_search
					.Find_EntityBeanOc_Station_Ben(Integer.valueOf(zhanweiA));
			sql = "select * " + " from OC_DATE_Ben WHERE DEL='OFF' "
					+ " AND OC_VOYAGE_ID=" + hangciA + " AND OC_STATION_ID IN ("
					+ zhanweiA + ")" + " AND OC_DEPLIST_ID IN(" + oc_depthlist
					+ ") " + " AND OC_PROPERTY_ID=" + P_A
					+ " AND OC_PROPERTY_TOOLS_ID=" + PTOOL_A;
			if (MIN_A != "") {
				sql = sql + " AND VALUE_KEY >=" + MIN_A;
			}
			if (MAX_A != "") {
				sql = sql + " AND VALUE_KEY <=" + MAX_A;
			}
			System.out.println("sql=" + sql);
			sql_list.add(sql);
            if(!"-1".endsWith(kekaoB)&& kekaoB!="-1"){
			EntityBeanOc_Station_Ben e2 = this.service_search.Find_Oc_Station_Ben_by_L_D(e.getLongitude(), e
							.getDimensionality(), hangciB);

			if (e2.getId() != null) {
				sql = "select * " + " from OC_DATE_BEN WHERE DEL='OFF' "
						+ "AND OC_VOYAGE_ID=" + hangciB
						+ " AND OC_STATION_ID IN (" + e2.getId() + ")"
						+ " AND OC_DEPLIST_ID IN(" + oc_depthlist + ") "
						+ "AND OC_PROPERTY_ID=" + P_B
						+ " AND OC_PROPERTY_TOOLS_ID=" + PTOOL_B;
				if (MIN_C != "") {
					sql = sql + " AND VALUE_KEY >=" + MIN_B;
				}
				if (MAX_B != "") {
					sql = sql + " AND VALUE_KEY <=" + MAX_B;
				}
				System.out.println("sql=" + sql);
				sql_list.add(sql);
			} else {
				System.out.println("δ�ܷ�����ͬվλ�������ѯ����");
			}
            }
            if(!"-1".endsWith(kekaoC)&& kekaoC!="-1"){
			EntityBeanOc_Station_Ben e3 = this.service_search
					.Find_Oc_Station_Ben_by_L_D(e.getLongitude(), e
							.getDimensionality(), hangciC);
			System.out.println("e3.getId()=" + e3.getId());
			if (e3.getId() != null) {
				
				sql = "select * " + " from OC_DATE_BEN WHERE DEL='OFF' "
						+ "AND OC_VOYAGE_ID=" + hangciC
						+ " AND OC_STATION_ID IN (" + e3.getId() + ")"
						+ " AND OC_DEPLIST_ID IN(" + oc_depthlist + ") "
						+ "AND OC_PROPERTY_ID=" + P_C
						+ " AND OC_PROPERTY_TOOLS_ID=" + PTOOL_C;
				if (MIN_C != "") {
					sql = sql + " AND VALUE_KEY >=" + MIN_C;
				}
				if (MAX_C != "") {
					sql = sql + " AND VALUE_KEY <=" + MAX_C;
				}
				System.out.println("sql=" + sql);
				sql_list.add(sql);

			} else {
				System.out.println("δ�ܷ�����ͬվλ�������ѯ����");
			}
            }
            if(!"-1".endsWith(kekaoD)&& kekaoD!="-1"){
			EntityBeanOc_Station_Ben e4 = this.service_search
					.Find_Oc_Station_Ben_by_L_D(e.getLongitude(), e.getDimensionality(), hangciD);
			System.out.println("e4.getId()=" + e4.getId());
			if (e4.getId() != null) {
				sql = "select * " + " from OC_DATE_BEN WHERE DEL='OFF' "
						+ "AND OC_VOYAGE_ID=" + hangciD
						+ " AND OC_STATION_ID IN (" + e4.getId() + ")"
						+ " AND OC_DEPLIST_ID IN(" + oc_depthlist + ") "
						+ "AND OC_PROPERTY_ID=" + P_D
						+ " AND OC_PROPERTY_TOOLS_ID=" + PTOOL_D;
				if (MIN_D != "") {
					sql = sql + " AND VALUE_KEY >=" + MIN_D;
				}
				if (MAX_D != "") {
					sql = sql + " AND VALUE_KEY <=" + MAX_D;
				}
				System.out.println("sql=" + sql);
				sql_list.add(sql);

			} else {
				System.out.println("δ�ܷ�����ͬվλ�������ѯ����");
			}
            }
            if(!"-1".endsWith(kekaoE)&& kekaoE!="-1"){
			EntityBeanOc_Station_Ben e5 = this.service_search
					.Find_Oc_Station_Ben_by_L_D(e.getLongitude(), e
							.getDimensionality(), hangciE);
			System.out.println("e5.getId()=" + e5.getId());
			if (e5.getId() != null) {
				sql = "select * " + " from OC_DATE_BEN WHERE DEL='OFF' "
						+ "AND OC_VOYAGE_ID=" + hangciE
						+ " AND OC_STATION_ID IN (" + e5.getId() + ")"
						+ " AND OC_DEPLIST_ID IN(" + oc_depthlist + ") "
						+ "AND OC_PROPERTY_ID=" + P_E
						+ " AND OC_PROPERTY_TOOLS_ID=" + PTOOL_E;
				if (MIN_E != "") {
					sql = sql + " AND VALUE_KEY >=" + MIN_E;
				}
				if (MAX_E != "") {
					sql = sql + " AND VALUE_KEY <=" + MAX_E;
				}
				System.out.println("sql=" + sql);
				sql_list.add(sql);
			} else {
				System.out.println("δ�ܷ�����ͬվλ�������ѯ����");
			}
            }
            if(!"-1".endsWith(kekaoF)&& kekaoF!="-1"){
			EntityBeanOc_Station_Ben e6 = this.service_search
					.Find_Oc_Station_Ben_by_L_D(e.getLongitude(), e
							.getDimensionality(), hangciF);
			System.out.println("e6.getId()=" + e6.getId());
			if (e6.getId() != null) {

				sql = "select * " + " from OC_DATE_BEN WHERE DEL='OFF' "
						+ "AND OC_VOYAGE_ID=" + hangciF
						+ " AND OC_STATION_ID IN (" + e6.getId() + ")"
						+ " AND OC_DEPLIST_ID IN(" + oc_depthlist + ") "
						+ "AND OC_PROPERTY_ID=" + P_F
						+ " AND OC_PROPERTY_TOOLS_ID=" + PTOOL_F;
				if (MIN_F != "") {
					sql = sql + " AND VALUE_KEY >=" + MIN_F;
				}
				if (MAX_F != "") {
					sql = sql + " AND VALUE_KEY <=" + MAX_F;
				}
				System.out.println("sql=" + sql);
				sql_list.add(sql);
			} else {
				System.out.println("δ�ܷ�����ͬվλ�������ѯ����");
			}
            }
			sql = "select depth from oc_depthlist_ben where id in (" + oc_depthlist
					+ ") and del='OFF' order by depth";
			try {
				rs = databaseconn.getStmt().executeQuery(sql);
				xmldate = xmldate + "<categories>";
				tabledata = tabledata + "<tr>" + "<td>" + "����/����" + "</td>";// �����ı��ı?
				while (rs.next()) {
					xmldate = xmldate + "<category label='"
							+ rs.getString("depth") + "(M)' />";
					tabledata = tabledata + "<td>" + rs.getString("depth")
							+ "(M)" + "</td>";
				}
				xmldate = xmldate + "</categories>";
				tabledata = tabledata + "</tr>";
			} catch (SQLException e1) {

				e1.printStackTrace();
			}

			for (int i = 0; i < sql_list.size(); i++) {
				try {
					rs = databaseconn.getStmt().executeQuery(sql_list.get(i));
					while (rs.next()) { 
						EnitityBeanOc_Date_Ben e1 = new EnitityBeanOc_Date_Ben();
						e1.setDel(rs.getString("DEL"));
						e1.setId(rs.getInt("ID"));
						e1.setOc_deplist_id(rs.getInt("OC_DEPLIST_ID"));
						e1.setOc_property_id(rs.getInt("OC_PROPERTY_ID"));
						e1.setOc_property_tools_id(rs
								.getInt("OC_PROPERTY_TOOLS_ID"));
						e1.setOc_station_id(rs.getInt("OC_STATION_ID"));
						e1.setOc_voyage_id(rs.getInt("OC_VOYAGE_ID"));
						e1.setValue_key(rs.getDouble("VALUE_KEY"));
						data.add(e1);
					}
					if (data.size() > 0) {
						sql = "select PROPERTY_NAME from oc_property_ben where ID="
								+ data.get(0).getOc_property_id();
						rs = databaseconn.getStmt().executeQuery(sql);
						String property_name = "";
						String property_tools = "";
						if (rs.next()) {
							property_name = rs.getString("PROPERTY_NAME");

						}
						sql = "select TOOLS_NAME from oc_property_tools_ben where ID="
								+ data.get(0).getOc_property_tools_id();
						rs = databaseconn.getStmt().executeQuery(sql);
						if (rs.next()) {
							property_tools = rs.getString("TOOLS_NAME");

						}
						xmldate = xmldate + "<dataset seriesName='"
								+ property_name + "(" + property_tools + ")'> ";
						tabledata = tabledata + "<tr><td>" + property_name
								+ "(" + property_tools + ")</td>";

					} else {
						tabledata = tabledata + "<tr><td>" + "null" + "("
								+ "null" + ")</td>";
					}
					String d[] = oc_depthlist.split(",");// ת��ʽ���ַ�����
					List<Integer> dep_list = new ArrayList();
					for (int k = 0; k < d.length; k++)// �Բ�������Ϊ��־������ѯ������
					{
						String AddEmpty = "yes";
						String value = "";
						for (int j = 0; j < data.size(); j++) {
							if (data.get(j).getOc_deplist_id().toString()
									.equals(d[k])) {
								value = data.get(j).getValue_key().toString();
								AddEmpty = "not";
								break;
							}
						}
						if (AddEmpty.endsWith("yes")) {

							xmldate = xmldate + "<set value='" + "'/>";
							tabledata = tabledata + "<td>" + "null" + "</td>";

						} else {

							xmldate = xmldate + "<set value='" + value + "'/>";
							tabledata = tabledata + "<td>" + value + "</td>";

						}

					}
					if (data.size() > 0) {
						xmldate = xmldate + "</dataset>";
						tabledata = tabledata + "</tr>";
						data.clear();
					}

				} catch (SQLException e41) {
					// TODO Auto-generated catch block
					e41.printStackTrace();
				}
			}

			xmldate = xmldate
					+ "<styles><definition><style name='CanvasAnim' type='animation' param='_xScale' start='0' duration='1' />"
					+ "</definition><application><apply toObject='Canvas' styles='CanvasAnim' /></application></styles></chart>";
			tabledata = tabledata + "</table>";

		} else if (function.equals("B")) {
			tabledata = "<table width='100%'><tr><td>**单一层深多层深多属性比较查询**</td></tr>";
			xmldate = "<chart exportEnabled='1' exportAtClient='1' exportHandler='fcExporter1' caption='**单一层深多层深多属性比较查询**'"
					+ " yAxisName='值' showValues='0' numberPrefix='value'>";


			String zhanweiString = "";
			if (!h_zhanweiG_A.equals("")) {
				zhanweiString = zhanweiString + this.cut_tail(h_zhanweiG_A);
			}
			if (!h_zhanweiG_B.equals("")) {
				zhanweiString = zhanweiString + ","
						+ this.cut_tail(h_zhanweiG_B);

			}
			if (!h_zhanweiG_C.equals("")) {
				zhanweiString = zhanweiString + ","
						+ this.cut_tail(h_zhanweiG_C);

			}
			if (!h_zhanweiG_D.equals("")) {
				zhanweiString = zhanweiString + ","
						+ this.cut_tail(h_zhanweiG_D);

			}
			if (!h_zhanweiG_E.equals("")) {
				zhanweiString = zhanweiString + ","
						+ this.cut_tail(h_zhanweiG_E);

			}
			if (!h_zhanweiG_F.equals("")) {
				zhanweiString = zhanweiString + ","
						+ this.cut_tail(h_zhanweiG_F);

			}

			sql = "select * from oc_station_ben where DEL='OFF' AND ID in ("
					+ zhanweiString + ")";
			rs = databaseconn.getStmt().executeQuery(sql);

			xmldate = xmldate + "<categories>";
			tabledata = tabledata + "<tr>" + "<td>" + "属性/站点" + "</td>";// �����ı��ı?
			String link = "";
			while (rs.next()) {
				System.out.println("�Ѿ���ȡ���,��ʼƴ��X��");
				xmldate = xmldate + "<category label='"
						+ rs.getString("STATION_NAME") + "'/>";
				tabledata = tabledata + "<td>" + rs.getString("STATION_NAME")
						+ "</td>";

				link = link + rs.getString("ID") + ",";
			}
			link = this.cut_tail(link);// ͨ����ݿ����վ�������
			xmldate = xmldate + "</categories>";
			tabledata = tabledata + "</tr>";

			List<String> temp_sql_list = new ArrayList<String>();
			h_zhanweiG_A = this.cut_tail(h_zhanweiG_A);
			h_zhanweiG_B = this.cut_tail(h_zhanweiG_B);
			h_zhanweiG_C = this.cut_tail(h_zhanweiG_C);
			h_zhanweiG_D = this.cut_tail(h_zhanweiG_D);
			h_zhanweiG_E = this.cut_tail(h_zhanweiG_E);
			h_zhanweiG_F = this.cut_tail(h_zhanweiG_F);

			temp_sql_list = this.make_sql_list_for_funtionB_Ben(h_zhanweiG_A,
					hangciA, depA, P_A, PTOOL_A, MIN_A, MAX_A);
			for (int temp = 0; temp < temp_sql_list.size(); temp++) {
				sql_list.add(temp_sql_list.get(temp));
			}

			temp_sql_list = this.make_sql_list_for_funtionB_Ben(h_zhanweiG_B,
					hangciB, depA, P_B, PTOOL_B, MIN_B, MAX_B);
			for (int temp = 0; temp < temp_sql_list.size(); temp++) {
				sql_list.add(temp_sql_list.get(temp));
			}

			temp_sql_list = this.make_sql_list_for_funtionB_Ben(h_zhanweiG_C,
					hangciC, depA, P_C, PTOOL_C, MIN_C, MAX_C);
			for (int temp = 0; temp < temp_sql_list.size(); temp++) {
				sql_list.add(temp_sql_list.get(temp));
			}

			temp_sql_list = this.make_sql_list_for_funtionB_Ben(h_zhanweiG_D,
					hangciD, depA, P_D, PTOOL_D, MIN_D, MAX_D);
			for (int temp = 0; temp < temp_sql_list.size(); temp++) {
				sql_list.add(temp_sql_list.get(temp));
			}

			temp_sql_list = this.make_sql_list_for_funtionB_Ben(h_zhanweiG_E,
					hangciE, depA, P_E, PTOOL_E, MIN_E, MAX_E);
			for (int temp = 0; temp < temp_sql_list.size(); temp++) {
				sql_list.add(temp_sql_list.get(temp));
			}

			temp_sql_list = this.make_sql_list_for_funtionB_Ben(h_zhanweiG_F,
					hangciF, depA, P_F, PTOOL_F, MIN_F, MAX_F);
			for (int temp = 0; temp < temp_sql_list.size(); temp++) {
				sql_list.add(temp_sql_list.get(temp));
			}


			for (int s_all = 0; s_all < sql_list.size(); s_all++) {
				System.out.println(sql_list.get(s_all));
				rs = databaseconn.getStmt().executeQuery(sql_list.get(s_all));
				xmldate = xmldate + this.Link_DataDraw_FunctionB_Xml_Ben(rs, link);
				tabledata = tabledata
						+ this.Link_DataDraw_FunctionB_Tab_Ben(rs, link);
			}

			xmldate = xmldate
					+ "<styles><definition><style name='CanvasAnim' type='animation' param='_xScale' start='0' duration='1' />"
					+ "</definition><application><apply toObject='Canvas' styles='CanvasAnim' /></application></styles></chart>";
			tabledata = tabledata + "</table>";

		} else if (function.equals("C")) {
			System.out.println("ѡ��һ����");
			tabledata = "<table width='100%'><tr><td>**单一层深多层深多属性比较查询**</td></tr>";
			xmldate = "<chart exportEnabled='1' exportAtClient='1' exportHandler='fcExporter1' caption='**单一层深多层深多属性比较查询**' xAxisName='վ��'"
					+ " yAxisName='值' showValues='0' numberPrefix='value'>";

			String zhanweiString = "";
			if (!h_zhanweiG_A.equals("")) {
				zhanweiString = zhanweiString + this.cut_tail(h_zhanweiG_A);
			}
			if (!h_zhanweiG_B.equals("")) {
				zhanweiString = zhanweiString + ","
						+ this.cut_tail(h_zhanweiG_B);

			}
			if (!h_zhanweiG_C.equals("")) {
				zhanweiString = zhanweiString + ","
						+ this.cut_tail(h_zhanweiG_C);

			}
			if (!h_zhanweiG_D.equals("")) {
				zhanweiString = zhanweiString + ","
						+ this.cut_tail(h_zhanweiG_D);

			}
			if (!h_zhanweiG_E.equals("")) {
				zhanweiString = zhanweiString + ","
						+ this.cut_tail(h_zhanweiG_E);

			}
			if (!h_zhanweiG_F.equals("")) {
				zhanweiString = zhanweiString + ","
						+ this.cut_tail(h_zhanweiG_F);

			}
			sql = "select * from oc_station_ben where DEL='OFF' AND ID in ("
					+ zhanweiString + ")";
			rs = databaseconn.getStmt().executeQuery(sql);

			xmldate = xmldate + "<categories>";
			tabledata = tabledata + "<tr>" + "<td>" + "站点/层深" + "</td>";// �����ı��ı?
			String link = "";
			while (rs.next()) {
				xmldate = xmldate + "<category label='"
						+ rs.getString("STATION_NAME") + "'/>";
				tabledata = tabledata + "<td>" + rs.getString("STATION_NAME")
						+ "</td>";

				link = link + rs.getString("ID") + ",";
			}
			link = this.cut_tail(link);// ͨ����ݿ����վ�������

			link = this.cut_tail(link);// ͨ����ݿ����վ�������
			xmldate = xmldate + "</categories>";
			tabledata = tabledata + "</tr>";

			List<String> temp_sql_list = new ArrayList<String>();
			h_zhanweiG_A = this.cut_tail(h_zhanweiG_A);
			h_zhanweiG_B = this.cut_tail(h_zhanweiG_B);
			h_zhanweiG_C = this.cut_tail(h_zhanweiG_C);
			h_zhanweiG_D = this.cut_tail(h_zhanweiG_D);
			h_zhanweiG_E = this.cut_tail(h_zhanweiG_E);
			h_zhanweiG_F = this.cut_tail(h_zhanweiG_F);

			temp_sql_list = this.make_sql_list_for_funtionC_Ben(h_zhanweiG_A,
					hangciA, depA, P_A, PTOOL_A, MIN_A, MAX_A);
			for (int temp = 0; temp < temp_sql_list.size(); temp++) {
				sql_list.add(temp_sql_list.get(temp));
			}

			temp_sql_list = this.make_sql_list_for_funtionC_Ben(h_zhanweiG_B,
					hangciB, depB, P_A, PTOOL_A, MIN_A, MAX_A);
			for (int temp = 0; temp < temp_sql_list.size(); temp++) {
				sql_list.add(temp_sql_list.get(temp));
			}

			temp_sql_list = this.make_sql_list_for_funtionC_Ben(h_zhanweiG_C,
					hangciC, depC, P_A, PTOOL_A, MIN_A, MAX_A);
			for (int temp = 0; temp < temp_sql_list.size(); temp++) {
				sql_list.add(temp_sql_list.get(temp));
			}

			temp_sql_list = this.make_sql_list_for_funtionC_Ben(h_zhanweiG_D,
					hangciD, depD, P_A, PTOOL_A, MIN_A, MAX_A);
			for (int temp = 0; temp < temp_sql_list.size(); temp++) {
				sql_list.add(temp_sql_list.get(temp));
			}

			temp_sql_list = this.make_sql_list_for_funtionC_Ben(h_zhanweiG_E,
					hangciE, depE, P_A, PTOOL_A, MIN_A, MAX_A);
			for (int temp = 0; temp < temp_sql_list.size(); temp++) {
				sql_list.add(temp_sql_list.get(temp));
			}

			temp_sql_list = this.make_sql_list_for_funtionC_Ben(h_zhanweiG_F,
					hangciF, depF, P_A, PTOOL_A, MIN_A, MAX_A);
			for (int temp = 0; temp < temp_sql_list.size(); temp++) {
				sql_list.add(temp_sql_list.get(temp));
			}
			System.out.println("sql_list.size()=" + sql_list.size());

			for (int s_all = 0; s_all < sql_list.size(); s_all++) {
				System.out.println(sql_list.get(s_all));
				rs = databaseconn.getStmt().executeQuery(sql_list.get(s_all));
				xmldate = xmldate + this.Link_DataDraw_FunctionC_Xml_Ben(rs, link);
				tabledata = tabledata
						+ this.Link_DataDraw_FunctionC_Tab_Ben(rs, link);
			}

			xmldate = xmldate
					+ "<styles><definition><style name='CanvasAnim' type='animation' param='_xScale' start='0' duration='1' />"
					+ "</definition><application><apply toObject='Canvas' styles='CanvasAnim' /></application></styles></chart>";
			tabledata = tabledata + "</table>";
		}
		System.out.println("tabledata=" + tabledata);
		System.out.println("xmldate=" + xmldate);
		databaseconn = null;// �ر���ݿ�����
		request.setAttribute("tabledata", tabledata);// �׳��������
		request.setAttribute("xmldate", xmldate);
		return mapping.findForward("success");

	}
	
	private String Link_DataDraw_FunctionC_Xml(ResultSet rs,
			String zhanweiString) throws SQLException {
		if (rs.isAfterLast()) {
			rs.beforeFirst();
		}
		List<EnitityBeanOc_Date_Sur> data = new ArrayList<EnitityBeanOc_Date_Sur>();
		while (rs.next()) {// ��ȡ��ݿ���ݵ��������Ա㴦�?
			System.out.println("��ݼ��ϲ�Ϊ��,��ʼƴ��XML�ַ�");
			EnitityBeanOc_Date_Sur e1 = new EnitityBeanOc_Date_Sur();
			e1.setDel(rs.getString("DEL"));
			e1.setId(rs.getInt("ID"));
			e1.setOc_deplist_id(rs.getInt("OC_DEPLIST_ID"));
			e1.setOc_property_id(rs.getInt("OC_PROPERTY_ID"));
			e1.setOc_property_tools_id(rs.getInt("OC_PROPERTY_TOOLS_ID"));
			e1.setOc_station_id(rs.getInt("OC_STATION_ID"));
			e1.setOc_voyage_id(rs.getInt("OC_VOYAGE_ID"));
			e1.setValue_key(rs.getDouble("VALUE_KEY"));
			data.add(e1);// ��ͬ�ֵĲ��������Ϊ��ݵĲ������Ե��� data �ĳ��ȺͲ���ĳ��Ȳ����
		}
		String depth_id = "";
		String xmldate = "";
		if (data.size() > 0) {
			depth_id = this.OC_DEPTHLIST(data.get(0).getOc_deplist_id()
					.toString());
			xmldate = xmldate + "<dataset seriesName='" + depth_id + "(" + "M"
					+ ")'> ";

		}
		System.out.println("zhanweiString=" + zhanweiString);
		String d[] = zhanweiString.split(",");// ת��ʽ���ַ�����
		System.out.println("d[].lengh=" + d.length);
		List<Integer> dep_list = new ArrayList();
		for (int k = 0; k < d.length; k++)// �Բ�������Ϊ��־������ѯ������
		{
			System.out.println("��ʾ��ѯ��¼�в��������ֵ" + d[k]
					+ ",ѭ�������ݽ���е�ֵ��������������Ч��� ��û�з�������ӿ���ֵ");
			String AddEmpty = "yes";
			String value = "";
			for (int j = 0; j < data.size(); j++) {
				if (data.get(j).getOc_station_id().toString().equals(d[k])) {
					value = data.get(j).getValue_key().toString();
					AddEmpty = "not";
					break;
				}
			}
			if (AddEmpty.endsWith("yes")) {

				xmldate = xmldate + "<set value='" + "'/>";

			} else {

				xmldate = xmldate + "<set value='" + value + "'/>";
			}

		}
		if (data.size() > 0) {
			xmldate = xmldate + "</dataset>";

			data.clear();
		}
		System.out.println("xmldate=" + xmldate);
		return xmldate;
	}

	private String Link_DataDraw_FunctionC_Xml_Ben(ResultSet rs,
			String zhanweiString) throws SQLException {
		if (rs.isAfterLast()) {
			rs.beforeFirst();
		}
		List<EnitityBeanOc_Date_Ben> data = new ArrayList<EnitityBeanOc_Date_Ben>();
		while (rs.next()) {// ��ȡ��ݿ���ݵ��������Ա㴦�?
			System.out.println("��ݼ��ϲ�Ϊ��,��ʼƴ��XML�ַ�");
			EnitityBeanOc_Date_Ben e1 = new EnitityBeanOc_Date_Ben();
			e1.setDel(rs.getString("DEL"));
			e1.setId(rs.getInt("ID"));
			e1.setOc_deplist_id(rs.getInt("OC_DEPLIST_ID"));
			e1.setOc_property_id(rs.getInt("OC_PROPERTY_ID"));
			e1.setOc_property_tools_id(rs.getInt("OC_PROPERTY_TOOLS_ID"));
			e1.setOc_station_id(rs.getInt("OC_STATION_ID"));
			e1.setOc_voyage_id(rs.getInt("OC_VOYAGE_ID"));
			e1.setValue_key(rs.getDouble("VALUE_KEY"));
			data.add(e1);// ��ͬ�ֵĲ��������Ϊ��ݵĲ������Ե��� data �ĳ��ȺͲ���ĳ��Ȳ����
		}
		String depth_id = "";
		String xmldate = "";
		if (data.size() > 0) {
			depth_id = this.OC_DEPTHLIST_BEN(data.get(0).getOc_deplist_id()
					.toString());
			xmldate = xmldate + "<dataset seriesName='" + depth_id + "(" + "M"
					+ ")'> ";

		}
		System.out.println("zhanweiString=" + zhanweiString);
		String d[] = zhanweiString.split(",");// ת��ʽ���ַ�����
		System.out.println("d[].lengh=" + d.length);
		List<Integer> dep_list = new ArrayList();
		for (int k = 0; k < d.length; k++)// �Բ�������Ϊ��־������ѯ������
		{
			System.out.println("��ʾ��ѯ��¼�в��������ֵ" + d[k]
					+ ",ѭ�������ݽ���е�ֵ��������������Ч��� ��û�з�������ӿ���ֵ");
			String AddEmpty = "yes";
			String value = "";
			for (int j = 0; j < data.size(); j++) {
				if (data.get(j).getOc_station_id().toString().equals(d[k])) {
					value = data.get(j).getValue_key().toString();
					AddEmpty = "not";
					break;
				}
			}
			if (AddEmpty.endsWith("yes")) {

				xmldate = xmldate + "<set value='" + "'/>";

			} else {

				xmldate = xmldate + "<set value='" + value + "'/>";
			}

		}
		if (data.size() > 0) {
			xmldate = xmldate + "</dataset>";

			data.clear();
		}
		System.out.println("xmldate=" + xmldate);
		return xmldate;
	}

	private String Link_DataDraw_FunctionC_Xml_Pla(ResultSet rs,
			String zhanweiString) throws SQLException {
		if (rs.isAfterLast()) {
			rs.beforeFirst();
		}
		List<EnitityBeanOc_Date_Pla> data = new ArrayList<EnitityBeanOc_Date_Pla>();
		while (rs.next()) {// ��ȡ��ݿ���ݵ��������Ա㴦�?
			System.out.println("��ݼ��ϲ�Ϊ��,��ʼƴ��XML�ַ�");
			EnitityBeanOc_Date_Pla e1 = new EnitityBeanOc_Date_Pla();
			e1.setDel(rs.getString("DEL"));
			e1.setId(rs.getInt("ID"));
			e1.setOc_deplist_id(rs.getInt("OC_DEPLIST_ID"));
			e1.setOc_property_id(rs.getInt("OC_PROPERTY_ID"));
			e1.setOc_property_tools_id(rs.getInt("OC_PROPERTY_TOOLS_ID"));
			e1.setOc_station_id(rs.getInt("OC_STATION_ID"));
			e1.setOc_voyage_id(rs.getInt("OC_VOYAGE_ID"));
			e1.setValue_key(rs.getDouble("VALUE_KEY"));
			data.add(e1);// ��ͬ�ֵĲ��������Ϊ��ݵĲ������Ե��� data �ĳ��ȺͲ���ĳ��Ȳ����
		}
		String depth_id = "";
		String xmldate = "";
		if (data.size() > 0) {
			depth_id = this.OC_DEPTHLIST_PLA(data.get(0).getOc_deplist_id()
					.toString());
			xmldate = xmldate + "<dataset seriesName='" + depth_id + "(" + "M"
					+ ")'> ";

		}
		System.out.println("zhanweiString=" + zhanweiString);
		String d[] = zhanweiString.split(",");// ת��ʽ���ַ�����
		System.out.println("d[].lengh=" + d.length);
		List<Integer> dep_list = new ArrayList();
		for (int k = 0; k < d.length; k++)// �Բ�������Ϊ��־������ѯ������
		{
			System.out.println("��ʾ��ѯ��¼�в��������ֵ" + d[k]
					+ ",ѭ�������ݽ���е�ֵ��������������Ч��� ��û�з�������ӿ���ֵ");
			String AddEmpty = "yes";
			String value = "";
			for (int j = 0; j < data.size(); j++) {
				if (data.get(j).getOc_station_id().toString().equals(d[k])) {
					value = data.get(j).getValue_key().toString();
					AddEmpty = "not";
					break;
				}
			}
			if (AddEmpty.endsWith("yes")) {

				xmldate = xmldate + "<set value='" + "'/>";

			} else {

				xmldate = xmldate + "<set value='" + value + "'/>";
			}

		}
		if (data.size() > 0) {
			xmldate = xmldate + "</dataset>";

			data.clear();
		}
		System.out.println("xmldate=" + xmldate);
		return xmldate;
	}

	private String Link_DataDraw_FunctionC_Xml_Ice(ResultSet rs,
			String zhanweiString) throws SQLException {
		if (rs.isAfterLast()) {
			rs.beforeFirst();
		}
		List<EnitityBeanOc_Date_Ice> data = new ArrayList<EnitityBeanOc_Date_Ice>();
		while (rs.next()) {// ��ȡ��ݿ���ݵ��������Ա㴦�?
			System.out.println("��ݼ��ϲ�Ϊ��,��ʼƴ��XML�ַ�");
			EnitityBeanOc_Date_Ice e1 = new EnitityBeanOc_Date_Ice();
			e1.setDel(rs.getString("DEL"));
			e1.setId(rs.getInt("ID"));
			e1.setOc_deplist_id(rs.getInt("OC_DEPLIST_ID"));
			e1.setOc_property_id(rs.getInt("OC_PROPERTY_ID"));
			e1.setOc_property_tools_id(rs.getInt("OC_PROPERTY_TOOLS_ID"));
			e1.setOc_station_id(rs.getInt("OC_STATION_ID"));
			e1.setOc_voyage_id(rs.getInt("OC_VOYAGE_ID"));
			e1.setValue_key(rs.getDouble("VALUE_KEY"));
			data.add(e1);// ��ͬ�ֵĲ��������Ϊ��ݵĲ������Ե��� data �ĳ��ȺͲ���ĳ��Ȳ����
		}
		String depth_id = "";
		String xmldate = "";
		if (data.size() > 0) {
			depth_id = this.OC_DEPTHLIST_ICE(data.get(0).getOc_deplist_id()
					.toString());
			xmldate = xmldate + "<dataset seriesName='" + depth_id + "(" + "M"
					+ ")'> ";

		}
		System.out.println("zhanweiString=" + zhanweiString);
		String d[] = zhanweiString.split(",");// ת��ʽ���ַ�����
		System.out.println("d[].lengh=" + d.length);
		List<Integer> dep_list = new ArrayList();
		for (int k = 0; k < d.length; k++)// �Բ�������Ϊ��־������ѯ������
		{
			String AddEmpty = "yes";
			String value = "";
			for (int j = 0; j < data.size(); j++) {
				if (data.get(j).getOc_station_id().toString().equals(d[k])) {
					value = data.get(j).getValue_key().toString();
					AddEmpty = "not";
					break;
				}
			}
			if (AddEmpty.endsWith("yes")) {

				xmldate = xmldate + "<set value='" + "'/>";

			} else {

				xmldate = xmldate + "<set value='" + value + "'/>";
			}

		}
		if (data.size() > 0) {
			xmldate = xmldate + "</dataset>";

			data.clear();
		}
		System.out.println("xmldate=" + xmldate);
		return xmldate;
	}

	
	
	private String Link_DataDraw_FunctionC_Tab(ResultSet rs,
			String zhanweiString) throws SQLException {
		if (rs.isAfterLast()) {
			rs.beforeFirst();
		}
		List<EnitityBeanOc_Date_Sur> data = new ArrayList<EnitityBeanOc_Date_Sur>();
		while (rs.next()) {// ��ȡ��ݿ���ݵ��������Ա㴦�?
			System.out.println("��ݼ��ϲ�Ϊ��,��ʼƴ��Table�ַ�");
			EnitityBeanOc_Date_Sur e1 = new EnitityBeanOc_Date_Sur();
			e1.setDel(rs.getString("DEL"));
			e1.setId(rs.getInt("ID"));
			e1.setOc_deplist_id(rs.getInt("OC_DEPLIST_ID"));
			e1.setOc_property_id(rs.getInt("OC_PROPERTY_ID"));
			e1.setOc_property_tools_id(rs.getInt("OC_PROPERTY_TOOLS_ID"));
			e1.setOc_station_id(rs.getInt("OC_STATION_ID"));
			e1.setOc_voyage_id(rs.getInt("OC_VOYAGE_ID"));
			e1.setValue_key(rs.getDouble("VALUE_KEY"));
			data.add(e1);// ��ͬ�ֵĲ��������Ϊ��ݵĲ������Ե��� data �ĳ��ȺͲ���ĳ��Ȳ����
		}
		String tabledata = "";
		String depth_c = "";
		if (data.size() > 0) {
			depth_c = this.OC_DEPTHLIST(data.get(0).getOc_deplist_id()
					.toString());
			tabledata = tabledata + "<tr><td>" + depth_c + "(" + "M" + ")</td>";
		} else {
			tabledata = tabledata + "<tr><td>" + "null" + "(" + "null"
					+ ")</td>";
		}
		System.out.println("zhanweiString=" + zhanweiString);
		String d[] = zhanweiString.split(",");// ת��ʽ���ַ�����
		System.out.println("d[].lengh=" + d.length);
		List<Integer> dep_list = new ArrayList();
		for (int k = 0; k < d.length; k++)// �Բ�������Ϊ��־������ѯ������
		{
			System.out.println("��ʾ��ѯ��¼�в��������ֵ" + d[k]
					+ ",ѭ�������ݽ���е�ֵ��������������Ч��� ��û�з�������ӿ���ֵ");
			String AddEmpty = "yes";
			String value = "";
			for (int j = 0; j < data.size(); j++) {
				if (data.get(j).getOc_station_id().toString().equals(d[k])) {
					value = data.get(j).getValue_key().toString();
					AddEmpty = "not";
					break;
				}
			}
			if (AddEmpty.endsWith("yes")) {

				tabledata = tabledata + "<td>" + "null" + "</td>";

			} else {

				tabledata = tabledata + "<td>" + value + "</td>";

			}

		}
		if (data.size() > 0) {
			tabledata = tabledata + "</tr>";

			data.clear();
		}
		System.out.println("tabledata=" + tabledata);
		return tabledata;
	}

	private String Link_DataDraw_FunctionC_Tab_Pla(ResultSet rs,
			String zhanweiString) throws SQLException {
		if (rs.isAfterLast()) {
			rs.beforeFirst();
		}
		List<EnitityBeanOc_Date_Pla> data = new ArrayList<EnitityBeanOc_Date_Pla>();
		while (rs.next()) {// ��ȡ��ݿ���ݵ��������Ա㴦�?
			System.out.println("��ݼ��ϲ�Ϊ��,��ʼƴ��Table�ַ�");
			EnitityBeanOc_Date_Pla e1 = new EnitityBeanOc_Date_Pla();
			e1.setDel(rs.getString("DEL"));
			e1.setId(rs.getInt("ID"));
			e1.setOc_deplist_id(rs.getInt("OC_DEPLIST_ID"));
			e1.setOc_property_id(rs.getInt("OC_PROPERTY_ID"));
			e1.setOc_property_tools_id(rs.getInt("OC_PROPERTY_TOOLS_ID"));
			e1.setOc_station_id(rs.getInt("OC_STATION_ID"));
			e1.setOc_voyage_id(rs.getInt("OC_VOYAGE_ID"));
			e1.setValue_key(rs.getDouble("VALUE_KEY"));
			data.add(e1);// ��ͬ�ֵĲ��������Ϊ��ݵĲ������Ե��� data �ĳ��ȺͲ���ĳ��Ȳ����
		}
		String tabledata = "";
		String depth_c = "";
		if (data.size() > 0) {
			depth_c = this.OC_DEPTHLIST_PLA(data.get(0).getOc_deplist_id()
					.toString());
			tabledata = tabledata + "<tr><td>" + depth_c + "(" + "M" + ")</td>";
		} else {
			tabledata = tabledata + "<tr><td>" + "null" + "(" + "null"
					+ ")</td>";
		}
		System.out.println("zhanweiString=" + zhanweiString);
		String d[] = zhanweiString.split(",");// ת��ʽ���ַ�����
		System.out.println("d[].lengh=" + d.length);
		List<Integer> dep_list = new ArrayList();
		for (int k = 0; k < d.length; k++)// �Բ�������Ϊ��־������ѯ������
		{
			System.out.println("��ʾ��ѯ��¼�в��������ֵ" + d[k]
					+ ",ѭ�������ݽ���е�ֵ��������������Ч��� ��û�з�������ӿ���ֵ");
			String AddEmpty = "yes";
			String value = "";
			for (int j = 0; j < data.size(); j++) {
				if (data.get(j).getOc_station_id().toString().equals(d[k])) {
					value = data.get(j).getValue_key().toString();
					AddEmpty = "not";
					break;
				}
			}
			if (AddEmpty.endsWith("yes")) {

				tabledata = tabledata + "<td>" + "null" + "</td>";

			} else {

				tabledata = tabledata + "<td>" + value + "</td>";

			}

		}
		if (data.size() > 0) {
			tabledata = tabledata + "</tr>";

			data.clear();
		}
		System.out.println("tabledata=" + tabledata);
		return tabledata;
	}


	private String Link_DataDraw_FunctionC_Tab_Ben(ResultSet rs,
			String zhanweiString) throws SQLException {
		if (rs.isAfterLast()) {
			rs.beforeFirst();
		}
		List<EnitityBeanOc_Date_Ben> data = new ArrayList<EnitityBeanOc_Date_Ben>();
		while (rs.next()) {// ��ȡ��ݿ���ݵ��������Ա㴦�?
			System.out.println("��ݼ��ϲ�Ϊ��,��ʼƴ��Table�ַ�");
			EnitityBeanOc_Date_Ben e1 = new EnitityBeanOc_Date_Ben();
			e1.setDel(rs.getString("DEL"));
			e1.setId(rs.getInt("ID"));
			e1.setOc_deplist_id(rs.getInt("OC_DEPLIST_ID"));
			e1.setOc_property_id(rs.getInt("OC_PROPERTY_ID"));
			e1.setOc_property_tools_id(rs.getInt("OC_PROPERTY_TOOLS_ID"));
			e1.setOc_station_id(rs.getInt("OC_STATION_ID"));
			e1.setOc_voyage_id(rs.getInt("OC_VOYAGE_ID"));
			e1.setValue_key(rs.getDouble("VALUE_KEY"));
			data.add(e1);// ��ͬ�ֵĲ��������Ϊ��ݵĲ������Ե��� data �ĳ��ȺͲ���ĳ��Ȳ����
		}
		String tabledata = "";
		String depth_c = "";
		if (data.size() > 0) {
			depth_c = this.OC_DEPTHLIST_BEN(data.get(0).getOc_deplist_id()
					.toString());
			tabledata = tabledata + "<tr><td>" + depth_c + "(" + "M" + ")</td>";
		} else {
			tabledata = tabledata + "<tr><td>" + "null" + "(" + "null"
					+ ")</td>";
		}
		System.out.println("zhanweiString=" + zhanweiString);
		String d[] = zhanweiString.split(",");// ת��ʽ���ַ�����
		System.out.println("d[].lengh=" + d.length);
		List<Integer> dep_list = new ArrayList();
		for (int k = 0; k < d.length; k++)// �Բ�������Ϊ��־������ѯ������
		{
			System.out.println("��ʾ��ѯ��¼�в��������ֵ" + d[k]
					+ ",ѭ�������ݽ���е�ֵ��������������Ч��� ��û�з�������ӿ���ֵ");
			String AddEmpty = "yes";
			String value = "";
			for (int j = 0; j < data.size(); j++) {
				if (data.get(j).getOc_station_id().toString().equals(d[k])) {
					value = data.get(j).getValue_key().toString();
					AddEmpty = "not";
					break;
				}
			}
			if (AddEmpty.endsWith("yes")) {

				tabledata = tabledata + "<td>" + "null" + "</td>";

			} else {

				tabledata = tabledata + "<td>" + value + "</td>";

			}

		}
		if (data.size() > 0) {
			tabledata = tabledata + "</tr>";

			data.clear();
		}
		System.out.println("tabledata=" + tabledata);
		return tabledata;
	}

	private String Link_DataDraw_FunctionC_Tab_ICE(ResultSet rs,
			String zhanweiString) throws SQLException {
		if (rs.isAfterLast()) {
			rs.beforeFirst();
		}
		List<EnitityBeanOc_Date_Ice> data = new ArrayList<EnitityBeanOc_Date_Ice>();
		while (rs.next()) {// ��ȡ��ݿ���ݵ��������Ա㴦�?
			System.out.println("��ݼ��ϲ�Ϊ��,��ʼƴ��Table�ַ�");
			EnitityBeanOc_Date_Ice e1 = new EnitityBeanOc_Date_Ice();
			e1.setDel(rs.getString("DEL"));
			e1.setId(rs.getInt("ID"));
			e1.setOc_deplist_id(rs.getInt("OC_DEPLIST_ID"));
			e1.setOc_property_id(rs.getInt("OC_PROPERTY_ID"));
			e1.setOc_property_tools_id(rs.getInt("OC_PROPERTY_TOOLS_ID"));
			e1.setOc_station_id(rs.getInt("OC_STATION_ID"));
			e1.setOc_voyage_id(rs.getInt("OC_VOYAGE_ID"));
			e1.setValue_key(rs.getDouble("VALUE_KEY"));
			data.add(e1);
		}
		String tabledata = "";
		String depth_c = "";
		if (data.size() > 0) {
			depth_c = this.OC_DEPTHLIST_ICE(data.get(0).getOc_deplist_id()
					.toString());
			tabledata = tabledata + "<tr><td>" + depth_c + "(" + "M" + ")</td>";
		} else {
			tabledata = tabledata + "<tr><td>" + "null" + "(" + "null"
					+ ")</td>";
		}
		System.out.println("zhanweiString=" + zhanweiString);
		String d[] = zhanweiString.split(",");// ת��ʽ���ַ�����
		System.out.println("d[].lengh=" + d.length);
		List<Integer> dep_list = new ArrayList();
		for (int k = 0; k < d.length; k++)// �Բ�������Ϊ��־������ѯ������
		{
			String AddEmpty = "yes";
			String value = "";
			for (int j = 0; j < data.size(); j++) {
				if (data.get(j).getOc_station_id().toString().equals(d[k])) {
					value = data.get(j).getValue_key().toString();
					AddEmpty = "not";
					break;
				}
			}
			if (AddEmpty.endsWith("yes")) {

				tabledata = tabledata + "<td>" + "null" + "</td>";

			} else {

				tabledata = tabledata + "<td>" + value + "</td>";

			}

		}
		if (data.size() > 0) {
			tabledata = tabledata + "</tr>";

			data.clear();
		}
		System.out.println("tabledata=" + tabledata);
		return tabledata;
	}

	private String Link_DataDraw_FunctionB_Tab(ResultSet rs,
			String zhanweiString) throws SQLException {
		if (rs.isAfterLast()) {
			rs.beforeFirst();
		}
		List<EnitityBeanOc_Date_Sur> data = new ArrayList<EnitityBeanOc_Date_Sur>();
		while (rs.next()) {// ��ȡ��ݿ���ݵ��������Ա㴦�?
			System.out.println("��ݼ��ϲ�Ϊ��,��ʼƴ��Table�ַ�");
			EnitityBeanOc_Date_Sur e1 = new EnitityBeanOc_Date_Sur();
			e1.setDel(rs.getString("DEL"));
			e1.setId(rs.getInt("ID"));
			e1.setOc_deplist_id(rs.getInt("OC_DEPLIST_ID"));
			e1.setOc_property_id(rs.getInt("OC_PROPERTY_ID"));
			e1.setOc_property_tools_id(rs.getInt("OC_PROPERTY_TOOLS_ID"));
			e1.setOc_station_id(rs.getInt("OC_STATION_ID"));
			e1.setOc_voyage_id(rs.getInt("OC_VOYAGE_ID"));
			e1.setValue_key(rs.getDouble("VALUE_KEY"));
			data.add(e1);// ��ͬ�ֵĲ��������Ϊ��ݵĲ������Ե��� data �ĳ��ȺͲ���ĳ��Ȳ����
		}
		String tabledata = "";
		String property_name = "";
		String property_tools = "";
		if (data.size() > 0) {
			property_name = this.OC_PROPERTY(data.get(0).getOc_property_id()
					.toString());
			property_tools = this.OC_PROPERTY_TOOLS(data.get(0)
					.getOc_property_tools_id().toString());
			tabledata = tabledata + "<tr><td>" + property_name + "("
					+ property_tools + ")</td>";
		} else {
			tabledata = tabledata + "<tr><td>" + "null" + "(" + "null"
					+ ")</td>";
		}
		System.out.println("zhanweiString=" + zhanweiString);
		String d[] = zhanweiString.split(",");// ת��ʽ���ַ�����
		System.out.println("d[].lengh=" + d.length);
		List<Integer> dep_list = new ArrayList();
		for (int k = 0; k < d.length; k++)// �Բ�������Ϊ��־������ѯ������
		{
			System.out.println("��ʾ��ѯ��¼�в��������ֵ" + d[k]
					+ ",ѭ�������ݽ���е�ֵ��������������Ч��� ��û�з�������ӿ���ֵ");
			String AddEmpty = "yes";
			String value = "";
			for (int j = 0; j < data.size(); j++) {
				if (data.get(j).getOc_station_id().toString().equals(d[k])) {
					value = data.get(j).getValue_key().toString();
					AddEmpty = "not";
					break;
				}
			}
			if (AddEmpty.endsWith("yes")) {

				tabledata = tabledata + "<td>" + "null" + "</td>";

			} else {

				tabledata = tabledata + "<td>" + value + "</td>";

			}

		}
		if (data.size() > 0) {
			tabledata = tabledata + "</tr>";

			data.clear();
		}
		System.out.println("tabledata=" + tabledata);
		return tabledata;
	}


	private String Link_DataDraw_FunctionB_Tab_Ben(ResultSet rs,
			String zhanweiString) throws SQLException {
		if (rs.isAfterLast()) {
			rs.beforeFirst();
		}
		List<EnitityBeanOc_Date_Ben> data = new ArrayList<EnitityBeanOc_Date_Ben>();
		while (rs.next()) {// ��ȡ��ݿ���ݵ��������Ա㴦�?
			System.out.println("��ݼ��ϲ�Ϊ��,��ʼƴ��Table�ַ�");
			EnitityBeanOc_Date_Ben e1 = new EnitityBeanOc_Date_Ben();
			e1.setDel(rs.getString("DEL"));
			e1.setId(rs.getInt("ID"));
			e1.setOc_deplist_id(rs.getInt("OC_DEPLIST_ID"));
			e1.setOc_property_id(rs.getInt("OC_PROPERTY_ID"));
			e1.setOc_property_tools_id(rs.getInt("OC_PROPERTY_TOOLS_ID"));
			e1.setOc_station_id(rs.getInt("OC_STATION_ID"));
			e1.setOc_voyage_id(rs.getInt("OC_VOYAGE_ID"));
			e1.setValue_key(rs.getDouble("VALUE_KEY"));
			data.add(e1);// ��ͬ�ֵĲ��������Ϊ��ݵĲ������Ե��� data �ĳ��ȺͲ���ĳ��Ȳ����
		}
		String tabledata = "";
		String property_name = "";
		String property_tools = "";
		if (data.size() > 0) {
			property_name = this.OC_PROPERTY_BEN(data.get(0).getOc_property_id()
					.toString());
			property_tools = this.OC_PROPERTY_TOOLS_BEN(data.get(0)
					.getOc_property_tools_id().toString());
			tabledata = tabledata + "<tr><td>" + property_name + "("
					+ property_tools + ")</td>";
		} else {
			tabledata = tabledata + "<tr><td>" + "null" + "(" + "null"
					+ ")</td>";
		}
		System.out.println("zhanweiString=" + zhanweiString);
		String d[] = zhanweiString.split(",");// ת��ʽ���ַ�����
		System.out.println("d[].lengh=" + d.length);
		List<Integer> dep_list = new ArrayList();
		for (int k = 0; k < d.length; k++)// �Բ�������Ϊ��־������ѯ������
		{
			System.out.println("��ʾ��ѯ��¼�в��������ֵ" + d[k]
					+ ",ѭ�������ݽ���е�ֵ��������������Ч��� ��û�з�������ӿ���ֵ");
			String AddEmpty = "yes";
			String value = "";
			for (int j = 0; j < data.size(); j++) {
				if (data.get(j).getOc_station_id().toString().equals(d[k])) {
					value = data.get(j).getValue_key().toString();
					AddEmpty = "not";
					break;
				}
			}
			if (AddEmpty.endsWith("yes")) {

				tabledata = tabledata + "<td>" + "null" + "</td>";

			} else {

				tabledata = tabledata + "<td>" + value + "</td>";

			}

		}
		if (data.size() > 0) {
			tabledata = tabledata + "</tr>";

			data.clear();
		}
		System.out.println("tabledata=" + tabledata);
		return tabledata;
	}


	private String Link_DataDraw_FunctionB_Tab_Pla(ResultSet rs,
			String zhanweiString) throws SQLException {
		if (rs.isAfterLast()) {
			rs.beforeFirst();
		}
		List<EnitityBeanOc_Date_Pla> data = new ArrayList<EnitityBeanOc_Date_Pla>();
		while (rs.next()) {// ��ȡ��ݿ���ݵ��������Ա㴦�?
			System.out.println("��ݼ��ϲ�Ϊ��,��ʼƴ��Table�ַ�");
			EnitityBeanOc_Date_Pla e1 = new EnitityBeanOc_Date_Pla();
			e1.setDel(rs.getString("DEL"));
			e1.setId(rs.getInt("ID"));
			e1.setOc_deplist_id(rs.getInt("OC_DEPLIST_ID"));
			e1.setOc_property_id(rs.getInt("OC_PROPERTY_ID"));
			e1.setOc_property_tools_id(rs.getInt("OC_PROPERTY_TOOLS_ID"));
			e1.setOc_station_id(rs.getInt("OC_STATION_ID"));
			e1.setOc_voyage_id(rs.getInt("OC_VOYAGE_ID"));
			e1.setValue_key(rs.getDouble("VALUE_KEY"));
			data.add(e1);// ��ͬ�ֵĲ��������Ϊ��ݵĲ������Ե��� data �ĳ��ȺͲ���ĳ��Ȳ����
		}
		String tabledata = "";
		String property_name = "";
		String property_tools = "";
		if (data.size() > 0) {
			property_name = this.OC_PROPERTY_PLA(data.get(0).getOc_property_id()
					.toString());
			property_tools = this.OC_PROPERTY_TOOLS_PLA(data.get(0)
					.getOc_property_tools_id().toString());
			tabledata = tabledata + "<tr><td>" + property_name + "("
					+ property_tools + ")</td>";
		} else {
			tabledata = tabledata + "<tr><td>" + "null" + "(" + "null"
					+ ")</td>";
		}
		System.out.println("zhanweiString=" + zhanweiString);
		String d[] = zhanweiString.split(",");// ת��ʽ���ַ�����
		System.out.println("d[].lengh=" + d.length);
		List<Integer> dep_list = new ArrayList();
		for (int k = 0; k < d.length; k++)// �Բ�������Ϊ��־������ѯ������
		{
			System.out.println("��ʾ��ѯ��¼�в��������ֵ" + d[k]
					+ ",ѭ�������ݽ���е�ֵ��������������Ч��� ��û�з�������ӿ���ֵ");
			String AddEmpty = "yes";
			String value = "";
			for (int j = 0; j < data.size(); j++) {
				if (data.get(j).getOc_station_id().toString().equals(d[k])) {
					value = data.get(j).getValue_key().toString();
					AddEmpty = "not";
					break;
				}
			}
			if (AddEmpty.endsWith("yes")) {

				tabledata = tabledata + "<td>" + "null" + "</td>";

			} else {

				tabledata = tabledata + "<td>" + value + "</td>";

			}

		}
		if (data.size() > 0) {
			tabledata = tabledata + "</tr>";

			data.clear();
		}
		System.out.println("tabledata=" + tabledata);
		return tabledata;
	}

	private String Link_DataDraw_FunctionB_Tab_ICE(ResultSet rs,
			String zhanweiString) throws SQLException {
		if (rs.isAfterLast()) {
			rs.beforeFirst();
		}
		List<EnitityBeanOc_Date_Ice> data = new ArrayList<EnitityBeanOc_Date_Ice>();
		while (rs.next()) {
			EnitityBeanOc_Date_Ice e1 = new EnitityBeanOc_Date_Ice();
			e1.setDel(rs.getString("DEL"));
			e1.setId(rs.getInt("ID"));
			e1.setOc_deplist_id(rs.getInt("OC_DEPLIST_ID"));
			e1.setOc_property_id(rs.getInt("OC_PROPERTY_ID"));
			e1.setOc_property_tools_id(rs.getInt("OC_PROPERTY_TOOLS_ID"));
			e1.setOc_station_id(rs.getInt("OC_STATION_ID"));
			e1.setOc_voyage_id(rs.getInt("OC_VOYAGE_ID"));
			e1.setValue_key(rs.getDouble("VALUE_KEY"));
			data.add(e1);
		}
		String tabledata = "";
		String property_name = "";
		String property_tools = "";
		if (data.size() > 0) {
			property_name = this.OC_PROPERTY_ICE(data.get(0).getOc_property_id()
					.toString());
			property_tools = this.OC_PROPERTY_TOOLS_ICE(data.get(0)
					.getOc_property_tools_id().toString());
			tabledata = tabledata + "<tr><td>" + property_name + "("
					+ property_tools + ")</td>";
		} else {
			tabledata = tabledata + "<tr><td>" + "null" + "(" + "null"
					+ ")</td>";
		}
		String d[] = zhanweiString.split(",");
		System.out.println("d[].lengh=" + d.length);
		List<Integer> dep_list = new ArrayList();
		for (int k = 0; k < d.length; k++)
		{
			String AddEmpty = "yes";
			String value = "";
			for (int j = 0; j < data.size(); j++) {
				if (data.get(j).getOc_station_id().toString().equals(d[k])) {
					value = data.get(j).getValue_key().toString();
					AddEmpty = "not";
					break;
				}
			}
			if (AddEmpty.endsWith("yes")) {

				tabledata = tabledata + "<td>" + "null" + "</td>";

			} else {

				tabledata = tabledata + "<td>" + value + "</td>";

			}

		}
		if (data.size() > 0) {
			tabledata = tabledata + "</tr>";

			data.clear();
		}
		System.out.println("tabledata=" + tabledata);
		return tabledata;
	}

	private String Link_DataDraw_FunctionB_Xml(ResultSet rs,
			String zhanweiString) throws SQLException {
		List<EnitityBeanOc_Date_Sur> data = new ArrayList<EnitityBeanOc_Date_Sur>();
		if (rs.isAfterLast()) {
			rs.beforeFirst();
		}
		while (rs.next()) {// ��ȡ��ݿ���ݵ��������Ա㴦�?
			System.out.println("��ݼ��ϲ�Ϊ��,��ʼƴ��XML�ַ�");
			EnitityBeanOc_Date_Sur e1 = new EnitityBeanOc_Date_Sur();
			e1.setDel(rs.getString("DEL"));
			e1.setId(rs.getInt("ID"));
			e1.setOc_deplist_id(rs.getInt("OC_DEPLIST_ID"));
			e1.setOc_property_id(rs.getInt("OC_PROPERTY_ID"));
			e1.setOc_property_tools_id(rs.getInt("OC_PROPERTY_TOOLS_ID"));
			e1.setOc_station_id(rs.getInt("OC_STATION_ID"));
			e1.setOc_voyage_id(rs.getInt("OC_VOYAGE_ID"));
			e1.setValue_key(rs.getDouble("VALUE_KEY"));
			data.add(e1);// ��ͬ�ֵĲ��������Ϊ��ݵĲ������Ե��� data �ĳ��ȺͲ���ĳ��Ȳ����
		}
		String property_name = "";
		String property_tools = "";
		String xmldate = "";
		if (data.size() > 0) {
			property_name = this.OC_PROPERTY(data.get(0).getOc_property_id()
					.toString());
			property_tools = this.OC_PROPERTY_TOOLS(data.get(0)
					.getOc_property_tools_id().toString());
			xmldate = xmldate + "<dataset seriesName='" + property_name + "("
					+ property_tools + ")'> ";

		}
		System.out.println("zhanweiString=" + zhanweiString);
		String d[] = zhanweiString.split(",");// ת��ʽ���ַ�����
		System.out.println("d[].lengh=" + d.length);
		List<Integer> dep_list = new ArrayList();
		for (int k = 0; k < d.length; k++)// �Բ�������Ϊ��־������ѯ������
		{
			System.out.println("��ʾ��ѯ��¼�в��������ֵ" + d[k]
					+ ",ѭ�������ݽ���е�ֵ��������������Ч��� ��û�з�������ӿ���ֵ");
			String AddEmpty = "yes";
			String value = "";
			for (int j = 0; j < data.size(); j++) {
				if (data.get(j).getOc_station_id().toString().equals(d[k])) {
					value = data.get(j).getValue_key().toString();
					AddEmpty = "not";
					break;
				}
			}
			if (AddEmpty.endsWith("yes")) {

				xmldate = xmldate + "<set value='" + "'/>";

			} else {

				xmldate = xmldate + "<set value='" + value + "'/>";

			}

		}
		if (data.size() > 0) {
			xmldate = xmldate + "</dataset>";

			data.clear();
		}
		System.out.println("xmldate=" + xmldate);
		return xmldate;
	}


	private String Link_DataDraw_FunctionB_Xml_Ben(ResultSet rs,
			String zhanweiString) throws SQLException {
		List<EnitityBeanOc_Date_Ben> data = new ArrayList<EnitityBeanOc_Date_Ben>();
		if (rs.isAfterLast()) {
			rs.beforeFirst();
		}
		while (rs.next()) {// ��ȡ��ݿ���ݵ��������Ա㴦�?
			System.out.println("��ݼ��ϲ�Ϊ��,��ʼƴ��XML�ַ�");
			EnitityBeanOc_Date_Ben e1 = new EnitityBeanOc_Date_Ben();
			e1.setDel(rs.getString("DEL"));
			e1.setId(rs.getInt("ID"));
			e1.setOc_deplist_id(rs.getInt("OC_DEPLIST_ID"));
			e1.setOc_property_id(rs.getInt("OC_PROPERTY_ID"));
			e1.setOc_property_tools_id(rs.getInt("OC_PROPERTY_TOOLS_ID"));
			e1.setOc_station_id(rs.getInt("OC_STATION_ID"));
			e1.setOc_voyage_id(rs.getInt("OC_VOYAGE_ID"));
			e1.setValue_key(rs.getDouble("VALUE_KEY"));
			data.add(e1);// ��ͬ�ֵĲ��������Ϊ��ݵĲ������Ե��� data �ĳ��ȺͲ���ĳ��Ȳ����
		}
		String property_name = "";
		String property_tools = "";
		String xmldate = "";
		if (data.size() > 0) {
			property_name = this.OC_PROPERTY_BEN(data.get(0).getOc_property_id()
					.toString());
			property_tools = this.OC_PROPERTY_TOOLS_BEN(data.get(0)
					.getOc_property_tools_id().toString());
			xmldate = xmldate + "<dataset seriesName='" + property_name + "("
					+ property_tools + ")'> ";

		}
		System.out.println("zhanweiString=" + zhanweiString);
		String d[] = zhanweiString.split(",");// ת��ʽ���ַ�����
		System.out.println("d[].lengh=" + d.length);
		List<Integer> dep_list = new ArrayList();
		for (int k = 0; k < d.length; k++)// �Բ�������Ϊ��־������ѯ������
		{
			System.out.println("��ʾ��ѯ��¼�в��������ֵ" + d[k]
					+ ",ѭ�������ݽ���е�ֵ��������������Ч��� ��û�з�������ӿ���ֵ");
			String AddEmpty = "yes";
			String value = "";
			for (int j = 0; j < data.size(); j++) {
				if (data.get(j).getOc_station_id().toString().equals(d[k])) {
					value = data.get(j).getValue_key().toString();
					AddEmpty = "not";
					break;
				}
			}
			if (AddEmpty.endsWith("yes")) {

				xmldate = xmldate + "<set value='" + "'/>";

			} else {

				xmldate = xmldate + "<set value='" + value + "'/>";

			}

		}
		if (data.size() > 0) {
			xmldate = xmldate + "</dataset>";

			data.clear();
		}
		System.out.println("xmldate=" + xmldate);
		return xmldate;
	}
	private String Link_DataDraw_FunctionB_Xml_ICE(ResultSet rs,
			String zhanweiString) throws SQLException {
		List<EnitityBeanOc_Date_Ice> data = new ArrayList<EnitityBeanOc_Date_Ice>();
		if (rs.isAfterLast()) {
			rs.beforeFirst();
		}
		while (rs.next()) {// ��ȡ��ݿ���ݵ��������Ա㴦�?
			System.out.println("��ݼ��ϲ�Ϊ��,��ʼƴ��XML�ַ�");
			EnitityBeanOc_Date_Ice e1 = new EnitityBeanOc_Date_Ice();
			e1.setDel(rs.getString("DEL"));
			e1.setId(rs.getInt("ID"));
			e1.setOc_deplist_id(rs.getInt("OC_DEPLIST_ID"));
			e1.setOc_property_id(rs.getInt("OC_PROPERTY_ID"));
			e1.setOc_property_tools_id(rs.getInt("OC_PROPERTY_TOOLS_ID"));
			e1.setOc_station_id(rs.getInt("OC_STATION_ID"));
			e1.setOc_voyage_id(rs.getInt("OC_VOYAGE_ID"));
			e1.setValue_key(rs.getDouble("VALUE_KEY"));
			data.add(e1);
		}
		String property_name = "";
		String property_tools = "";
		String xmldate = "";
		if (data.size() > 0) {
			property_name = this.OC_PROPERTY_ICE(data.get(0).getOc_property_id()
					.toString());
			property_tools = this.OC_PROPERTY_TOOLS_ICE(data.get(0)
					.getOc_property_tools_id().toString());
			xmldate = xmldate + "<dataset seriesName='" + property_name + "("
					+ property_tools + ")'> ";

		}
		System.out.println("zhanweiString=" + zhanweiString);
		String d[] = zhanweiString.split(",");// ת��ʽ���ַ�����
		System.out.println("d[].lengh=" + d.length);
		List<Integer> dep_list = new ArrayList();
		for (int k = 0; k < d.length; k++)// �Բ�������Ϊ��־������ѯ������
		{
			String AddEmpty = "yes";
			String value = "";
			for (int j = 0; j < data.size(); j++) {
				if (data.get(j).getOc_station_id().toString().equals(d[k])) {
					value = data.get(j).getValue_key().toString();
					AddEmpty = "not";
					break;
				}
			}
			if (AddEmpty.endsWith("yes")) {

				xmldate = xmldate + "<set value='" + "'/>";

			} else {

				xmldate = xmldate + "<set value='" + value + "'/>";

			}

		}
		if (data.size() > 0) {
			xmldate = xmldate + "</dataset>";

			data.clear();
		}
		System.out.println("xmldate=" + xmldate);
		return xmldate;
	}


	private String Link_DataDraw_FunctionB_Xml_Pla(ResultSet rs,
			String zhanweiString) throws SQLException {
		List<EnitityBeanOc_Date_Pla> data = new ArrayList<EnitityBeanOc_Date_Pla>();
		if (rs.isAfterLast()) {
			rs.beforeFirst();
		}
		while (rs.next()) {// ��ȡ��ݿ���ݵ��������Ա㴦�?
			System.out.println("��ݼ��ϲ�Ϊ��,��ʼƴ��XML�ַ�");
			EnitityBeanOc_Date_Pla e1 = new EnitityBeanOc_Date_Pla();
			e1.setDel(rs.getString("DEL"));
			e1.setId(rs.getInt("ID"));
			e1.setOc_deplist_id(rs.getInt("OC_DEPLIST_ID"));
			e1.setOc_property_id(rs.getInt("OC_PROPERTY_ID"));
			e1.setOc_property_tools_id(rs.getInt("OC_PROPERTY_TOOLS_ID"));
			e1.setOc_station_id(rs.getInt("OC_STATION_ID"));
			e1.setOc_voyage_id(rs.getInt("OC_VOYAGE_ID"));
			e1.setValue_key(rs.getDouble("VALUE_KEY"));
			data.add(e1);// ��ͬ�ֵĲ��������Ϊ��ݵĲ������Ե��� data �ĳ��ȺͲ���ĳ��Ȳ����
		}
		String property_name = "";
		String property_tools = "";
		String xmldate = "";
		if (data.size() > 0) {
			property_name = this.OC_PROPERTY_PLA(data.get(0).getOc_property_id()
					.toString());
			property_tools = this.OC_PROPERTY_TOOLS_PLA(data.get(0)
					.getOc_property_tools_id().toString());
			xmldate = xmldate + "<dataset seriesName='" + property_name + "("
					+ property_tools + ")'> ";

		}
		System.out.println("zhanweiString=" + zhanweiString);
		String d[] = zhanweiString.split(",");// ת��ʽ���ַ�����
		System.out.println("d[].lengh=" + d.length);
		List<Integer> dep_list = new ArrayList();
		for (int k = 0; k < d.length; k++)// �Բ�������Ϊ��־������ѯ������
		{
			System.out.println("��ʾ��ѯ��¼�в��������ֵ" + d[k]
					+ ",ѭ�������ݽ���е�ֵ��������������Ч��� ��û�з�������ӿ���ֵ");
			String AddEmpty = "yes";
			String value = "";
			for (int j = 0; j < data.size(); j++) {
				if (data.get(j).getOc_station_id().toString().equals(d[k])) {
					value = data.get(j).getValue_key().toString();
					AddEmpty = "not";
					break;
				}
			}
			if (AddEmpty.endsWith("yes")) {

				xmldate = xmldate + "<set value='" + "'/>";

			} else {

				xmldate = xmldate + "<set value='" + value + "'/>";

			}

		}
		if (data.size() > 0) {
			xmldate = xmldate + "</dataset>";

			data.clear();
		}
		System.out.println("xmldate=" + xmldate);
		return xmldate;
	}


	private String OC_DEPTHLIST(String oc_dep_id) throws SQLException {
		Read_Properties Read_Properties = new Read_Properties(
				"db_cn.properties");
		String ip = Read_Properties.Read_Properties_root("ip");
		String port = Read_Properties.Read_Properties_root("port");
		String service = Read_Properties.Read_Properties_root("servicname");
		String username = Read_Properties.Read_Properties_root("username");
		String password = Read_Properties.Read_Properties_root("password");
		DataBaseConn databaseconn = new DataBaseConn(ip, port, service,
				username, password);
		ResultSet rs = null;
		String sql = "select DEPTH  from OC_DEPTHLIST where del='OFF' and id="
				+ oc_dep_id;
		rs = databaseconn.getStmt().executeQuery(sql);
		String OC_DEPTHLIST = "";
		while (rs.next()) {
			OC_DEPTHLIST = rs.getString("DEPTH");
		}
		Read_Properties = null;
		databaseconn.getStmt().close();
		databaseconn.getConn().close();
		databaseconn = null;
		rs = null;
		return OC_DEPTHLIST;
	}

	
	
	private String OC_DEPTHLIST_BEN(String oc_dep_id) throws SQLException {
		Read_Properties Read_Properties = new Read_Properties(
				"db_cn.properties");
		String ip = Read_Properties.Read_Properties_root("ip");
		String port = Read_Properties.Read_Properties_root("port");
		String service = Read_Properties.Read_Properties_root("servicname");
		String username = Read_Properties.Read_Properties_root("username");
		String password = Read_Properties.Read_Properties_root("password");
		DataBaseConn databaseconn = new DataBaseConn(ip, port, service,
				username, password);
		ResultSet rs = null;
		String sql = "select DEPTH  from OC_DEPTHLIST_BEN where del='OFF' and id="
				+ oc_dep_id;
		rs = databaseconn.getStmt().executeQuery(sql);
		String OC_DEPTHLIST = "";
		while (rs.next()) {
			OC_DEPTHLIST = rs.getString("DEPTH");
		}
		Read_Properties = null;
		databaseconn.getStmt().close();
		databaseconn.getConn().close();
		databaseconn = null;
		rs = null;
		return OC_DEPTHLIST;
	}


	private String OC_DEPTHLIST_PLA(String oc_dep_id) throws SQLException {
		Read_Properties Read_Properties = new Read_Properties(
				"db_cn.properties");
		String ip = Read_Properties.Read_Properties_root("ip");
		String port = Read_Properties.Read_Properties_root("port");
		String service = Read_Properties.Read_Properties_root("servicname");
		String username = Read_Properties.Read_Properties_root("username");
		String password = Read_Properties.Read_Properties_root("password");
		DataBaseConn databaseconn = new DataBaseConn(ip, port, service,
				username, password);
		ResultSet rs = null;
		String sql = "select DEPTH  from OC_DEPTHLIST_BEN where del='OFF' and id="
				+ oc_dep_id;
		rs = databaseconn.getStmt().executeQuery(sql);
		String OC_DEPTHLIST = "";
		while (rs.next()) {
			OC_DEPTHLIST = rs.getString("DEPTH");
		}
		Read_Properties = null;
		databaseconn.getStmt().close();
		databaseconn.getConn().close();
		databaseconn = null;
		rs = null;
		return OC_DEPTHLIST;
	}

	private String OC_DEPTHLIST_ICE(String oc_dep_id) throws SQLException {
		Read_Properties Read_Properties = new Read_Properties(
				"db_cn.properties");
		String ip = Read_Properties.Read_Properties_root("ip");
		String port = Read_Properties.Read_Properties_root("port");
		String service = Read_Properties.Read_Properties_root("servicname");
		String username = Read_Properties.Read_Properties_root("username");
		String password = Read_Properties.Read_Properties_root("password");
		DataBaseConn databaseconn = new DataBaseConn(ip, port, service,
				username, password);
		ResultSet rs = null;
		String sql = "select DEPTH  from OC_DEPTHLIST_ICE where del='OFF' and id="
				+ oc_dep_id;
		rs = databaseconn.getStmt().executeQuery(sql);
		String OC_DEPTHLIST = "";
		while (rs.next()) {
			OC_DEPTHLIST = rs.getString("DEPTH");
		}
		Read_Properties = null;
		databaseconn.getStmt().close();
		databaseconn.getConn().close();
		databaseconn = null;
		rs = null;
		return OC_DEPTHLIST;
	}
	
	private String OC_PROPERTY(String oc_p_id) throws SQLException// ������Ե�ID������Ӧ���������
	{
		Read_Properties Read_Properties = new Read_Properties(
				"db_cn.properties");
		String ip = Read_Properties.Read_Properties_root("ip");
		String port = Read_Properties.Read_Properties_root("port");
		String service = Read_Properties.Read_Properties_root("servicname");
		String username = Read_Properties.Read_Properties_root("username");
		String password = Read_Properties.Read_Properties_root("password");
		DataBaseConn databaseconn = new DataBaseConn(ip, port, service,
				username, password);
		ResultSet rs = null;
		String sql = "select PROPERTY_NAME from OC_PROPERTY where ID="
				+ oc_p_id;
		rs = databaseconn.getStmt().executeQuery(sql);
		String OC_PROPERTY = "";
		while (rs.next()) {
			OC_PROPERTY = rs.getString("PROPERTY_NAME");
		}
		Read_Properties = null;
		databaseconn.getStmt().close();
		databaseconn.getConn().close();
		databaseconn = null;
		rs = null;
		return OC_PROPERTY;
	}


	private String OC_PROPERTY_PLA(String oc_p_id) throws SQLException// ������Ե�ID������Ӧ���������
	{
		Read_Properties Read_Properties = new Read_Properties(
				"db_cn.properties");
		String ip = Read_Properties.Read_Properties_root("ip");
		String port = Read_Properties.Read_Properties_root("port");
		String service = Read_Properties.Read_Properties_root("servicname");
		String username = Read_Properties.Read_Properties_root("username");
		String password = Read_Properties.Read_Properties_root("password");
		DataBaseConn databaseconn = new DataBaseConn(ip, port, service,
				username, password);
		ResultSet rs = null;
		String sql = "select PROPERTY_NAME from OC_PROPERTY_PLA where ID="
				+ oc_p_id;
		rs = databaseconn.getStmt().executeQuery(sql);
		String OC_PROPERTY = "";
		while (rs.next()) {
			OC_PROPERTY = rs.getString("PROPERTY_NAME");
		}
		Read_Properties = null;
		databaseconn.getStmt().close();
		databaseconn.getConn().close();
		databaseconn = null;
		rs = null;
		return OC_PROPERTY;
	}


	private String OC_PROPERTY_BEN(String oc_p_id) throws SQLException// ������Ե�ID������Ӧ���������
	{
		Read_Properties Read_Properties = new Read_Properties(
				"db_cn.properties");
		String ip = Read_Properties.Read_Properties_root("ip");
		String port = Read_Properties.Read_Properties_root("port");
		String service = Read_Properties.Read_Properties_root("servicname");
		String username = Read_Properties.Read_Properties_root("username");
		String password = Read_Properties.Read_Properties_root("password");
		DataBaseConn databaseconn = new DataBaseConn(ip, port, service,
				username, password);
		ResultSet rs = null;
		String sql = "select PROPERTY_NAME from OC_PROPERTY_BEN where ID="
				+ oc_p_id;
		rs = databaseconn.getStmt().executeQuery(sql);
		String OC_PROPERTY = "";
		while (rs.next()) {
			OC_PROPERTY = rs.getString("PROPERTY_NAME");
		}
		Read_Properties = null;
		databaseconn.getStmt().close();
		databaseconn.getConn().close();
		databaseconn = null;
		rs = null;
		return OC_PROPERTY;
	}
	private String OC_PROPERTY_ICE(String oc_p_id) throws SQLException// ������Ե�ID������Ӧ���������
	{
		Read_Properties Read_Properties = new Read_Properties(
				"db_cn.properties");
		String ip = Read_Properties.Read_Properties_root("ip");
		String port = Read_Properties.Read_Properties_root("port");
		String service = Read_Properties.Read_Properties_root("servicname");
		String username = Read_Properties.Read_Properties_root("username");
		String password = Read_Properties.Read_Properties_root("password");
		DataBaseConn databaseconn = new DataBaseConn(ip, port, service,
				username, password);
		ResultSet rs = null;
		String sql = "select PROPERTY_NAME from OC_PROPERTY_ICE where ID="
				+ oc_p_id;
		rs = databaseconn.getStmt().executeQuery(sql);
		String OC_PROPERTY = "";
		while (rs.next()) {
			OC_PROPERTY = rs.getString("PROPERTY_NAME");
		}
		Read_Properties = null;
		databaseconn.getStmt().close();
		databaseconn.getConn().close();
		databaseconn = null;
		rs = null;
		return OC_PROPERTY;
	}
	
	
	private String OC_PROPERTY_TOOLS_PLA(String oc_p_tools) throws SQLException// ������Ե�ID������Ӧ�����Թ������
	{

		Read_Properties Read_Properties = new Read_Properties(
				"db_cn.properties");
		String ip = Read_Properties.Read_Properties_root("ip");
		String port = Read_Properties.Read_Properties_root("port");
		String service = Read_Properties.Read_Properties_root("servicname");
		String username = Read_Properties.Read_Properties_root("username");
		String password = Read_Properties.Read_Properties_root("password");
		DataBaseConn databaseconn = new DataBaseConn(ip, port, service,
				username, password);
		ResultSet rs = null;

		String sql = "select TOOLS_NAME from OC_PROPERTY_TOOLS_PLA where ID="
				+ oc_p_tools;

		rs = databaseconn.getStmt().executeQuery(sql);
		String OC_PROPERTY = "";
		while (rs.next()) {
			OC_PROPERTY = rs.getString("TOOLS_NAME");
		}
		Read_Properties = null;
		databaseconn.getStmt().close();
		databaseconn.getConn().close();
		databaseconn = null;
		rs = null;
		return OC_PROPERTY;
	}
	private String OC_PROPERTY_TOOLS_ICE(String oc_p_tools) throws SQLException// ������Ե�ID������Ӧ�����Թ������
	{

		Read_Properties Read_Properties = new Read_Properties(
				"db_cn.properties");
		String ip = Read_Properties.Read_Properties_root("ip");
		String port = Read_Properties.Read_Properties_root("port");
		String service = Read_Properties.Read_Properties_root("servicname");
		String username = Read_Properties.Read_Properties_root("username");
		String password = Read_Properties.Read_Properties_root("password");
		DataBaseConn databaseconn = new DataBaseConn(ip, port, service,
				username, password);
		ResultSet rs = null;

		String sql = "select TOOLS_NAME from OC_PROPERTY_TOOLS_ICE where ID="
				+ oc_p_tools;

		rs = databaseconn.getStmt().executeQuery(sql);
		String OC_PROPERTY = "";
		while (rs.next()) {
			OC_PROPERTY = rs.getString("TOOLS_NAME");
		}
		Read_Properties = null;
		databaseconn.getStmt().close();
		databaseconn.getConn().close();
		databaseconn = null;
		rs = null;
		return OC_PROPERTY;
	}

	
	private String OC_PROPERTY_TOOLS_BEN(String oc_p_tools) throws SQLException// ������Ե�ID������Ӧ�����Թ������
	{

		Read_Properties Read_Properties = new Read_Properties(
				"db_cn.properties");
		String ip = Read_Properties.Read_Properties_root("ip");
		String port = Read_Properties.Read_Properties_root("port");
		String service = Read_Properties.Read_Properties_root("servicname");
		String username = Read_Properties.Read_Properties_root("username");
		String password = Read_Properties.Read_Properties_root("password");
		DataBaseConn databaseconn = new DataBaseConn(ip, port, service,
				username, password);
		ResultSet rs = null;

		String sql = "select TOOLS_NAME from OC_PROPERTY_TOOLS_BEN where ID="
				+ oc_p_tools;

		rs = databaseconn.getStmt().executeQuery(sql);
		String OC_PROPERTY = "";
		while (rs.next()) {
			OC_PROPERTY = rs.getString("TOOLS_NAME");
		}
		Read_Properties = null;
		databaseconn.getStmt().close();
		databaseconn.getConn().close();
		databaseconn = null;
		rs = null;
		return OC_PROPERTY;
	}

	
	
	private String OC_PROPERTY_TOOLS(String oc_p_tools) throws SQLException// ������Ե�ID������Ӧ�����Թ������
	{

		Read_Properties Read_Properties = new Read_Properties(
				"db_cn.properties");
		String ip = Read_Properties.Read_Properties_root("ip");
		String port = Read_Properties.Read_Properties_root("port");
		String service = Read_Properties.Read_Properties_root("servicname");
		String username = Read_Properties.Read_Properties_root("username");
		String password = Read_Properties.Read_Properties_root("password");
		DataBaseConn databaseconn = new DataBaseConn(ip, port, service,
				username, password);
		ResultSet rs = null;

		String sql = "select TOOLS_NAME from OC_PROPERTY_TOOLS where ID="
				+ oc_p_tools;

		rs = databaseconn.getStmt().executeQuery(sql);
		String OC_PROPERTY = "";
		while (rs.next()) {
			OC_PROPERTY = rs.getString("TOOLS_NAME");
		}
		Read_Properties = null;
		databaseconn.getStmt().close();
		databaseconn.getConn().close();
		databaseconn = null;
		rs = null;
		return OC_PROPERTY;
	}

	private List<String> make_sql_list_for_funtionC(String s, String hangci,
			String dep, String P, String PTOOL, String MIN, String MAX) {
		List<String> list = new ArrayList();
		String str = "";
		if(s!=""&&hangci!=""&&dep!=""&&P!=""&&PTOOL!="")
		{
		str = "SELECT * from OC_DATE_SUR where DEL='OFF'"
				+ " AND OC_VOYAGE_ID=" + hangci + " and OC_STATION_ID in (" + s
				+ ") and OC_DEPLIST_ID= " + dep + " and OC_PROPERTY_ID= " + P
				+ " and OC_PROPERTY_TOOLS_ID=" + PTOOL;
		if (MIN != "") {
			str = str + " AND VALUE_KEY >=" + MIN;
		}
		if (MAX != "") {
			str = str + " AND VALUE_KEY <=" + MAX;
		}
		list.add(str);
		}
		return list;
	}

	
	private List<String> make_sql_list_for_funtionC_Pla(String s, String hangci,
			String dep, String P, String PTOOL, String MIN, String MAX) {
		List<String> list = new ArrayList();
		String str = "";
		if(s!=""&&hangci!=""&&dep!=""&&P!=""&&PTOOL!="")
		{
		str = "SELECT * from OC_DATE_PLA where DEL='OFF'"
				+ " AND OC_VOYAGE_ID=" + hangci + " and OC_STATION_ID in (" + s
				+ ") and OC_DEPLIST_ID= " + dep + " and OC_PROPERTY_ID= " + P
				+ " and OC_PROPERTY_TOOLS_ID=" + PTOOL;
		if (MIN != "") {
			str = str + " AND VALUE_KEY >=" + MIN;
		}
		if (MAX != "") {
			str = str + " AND VALUE_KEY <=" + MAX;
		}
		list.add(str);
		}
		return list;
	}
	

	private List<String> make_sql_list_for_funtionC_Ben(String s, String hangci,
			String dep, String P, String PTOOL, String MIN, String MAX) {
		List<String> list = new ArrayList();
		if(s!=""&&hangci!=""&&dep!=""&&P!=""&&PTOOL!="")
		{
		String str = "";
		str = "SELECT * from OC_DATE_BEN where DEL='OFF'"
				+ " AND OC_VOYAGE_ID=" + hangci + " and OC_STATION_ID in (" + s
				+ ") and OC_DEPLIST_ID= " + dep + " and OC_PROPERTY_ID= " + P
				+ " and OC_PROPERTY_TOOLS_ID=" + PTOOL;
		if (MIN != "") {
			str = str + " AND VALUE_KEY >=" + MIN;
		}
		if (MAX != "") {
			str = str + " AND VALUE_KEY <=" + MAX;
		}
		list.add(str);
		}
		return list;
	}
	private List<String> make_sql_list_for_funtionC_ICE(String s, String hangci,
			String dep, String P, String PTOOL, String MIN, String MAX) {
		List<String> list = new ArrayList();
		String str = "";
		str = "SELECT * from OC_DATE_ICE where DEL='OFF'"
				+ " AND OC_VOYAGE_ID=" + hangci + " and OC_STATION_ID in (" + s
				+ ") and OC_DEPLIST_ID= " + dep + " and OC_PROPERTY_ID= " + P
				+ " and OC_PROPERTY_TOOLS_ID=" + PTOOL;
		if (MIN != "") {
			str = str + " AND VALUE_KEY >=" + MIN;
		}
		if (MAX != "") {
			str = str + " AND VALUE_KEY <=" + MAX;
		}
		list.add(str);
		return list;
	}
	
	
	@SuppressWarnings("unchecked")
	private List<String> make_sql_list_for_funtionB(String s, String hangci,
			String dep, String P, String PTOOL, String MIN, String MAX) {
		List<String> list = new ArrayList();
		String str = "";
		if(!s.equals("")&&!hangci.equals("")&&!dep.equals("")&&!P.equals("")&&!PTOOL.equals(""))
		{
		str = "SELECT * from OC_DATE_SUR where DEL='OFF'"
				+ " AND OC_VOYAGE_ID=" + hangci + " and OC_STATION_ID in (" + s
				+ ") and OC_DEPLIST_ID= " + dep + " and OC_PROPERTY_ID= " + P
				+ " and OC_PROPERTY_TOOLS_ID=" + PTOOL;
		if (MIN != "") {
			str = str + " AND VALUE_KEY >=" + MIN;
		}
		if (MAX != "") {
			str = str + " AND VALUE_KEY <=" + MAX;
		}
		list.add(str);
		}
		return list;
	}

	@SuppressWarnings("unchecked")
	private List<String> make_sql_list_for_funtionB_Pla(String s, String hangci,
			String dep, String P, String PTOOL, String MIN, String MAX) {
		List<String> list = new ArrayList();
		String str = "";
		if(!s.equals("")&&!hangci.equals("")&&!dep.equals("")&&!P.equals("")&&!PTOOL.equals(""))
		{
		str = "SELECT * from OC_DATE_PLA where DEL='OFF'"
				+ " AND OC_VOYAGE_ID=" + hangci + " and OC_STATION_ID in (" + s
				+ ") and OC_DEPLIST_ID= " + dep + " and OC_PROPERTY_ID= " + P
				+ " and OC_PROPERTY_TOOLS_ID=" + PTOOL;
		if (MIN != "") {
			str = str + " AND VALUE_KEY >=" + MIN;
		}
		if (MAX != "") {
			str = str + " AND VALUE_KEY <=" + MAX;
		}
		list.add(str);
		}
		return list;
	}
	
	@SuppressWarnings("unchecked")
	private List<String> make_sql_list_for_funtionB_Ben(String s, String hangci,
			String dep, String P, String PTOOL, String MIN, String MAX) {
		List<String> list = new ArrayList();
		String str = "";
		if(!s.equals("")&&!hangci.equals("")&&!dep.equals("")&&!P.equals("")&&!PTOOL.equals(""))
		{
		str = "SELECT * from OC_DATE_Ben where DEL='OFF'"
				+ " AND OC_VOYAGE_ID=" + hangci + " and OC_STATION_ID in (" + s
				+ ") and OC_DEPLIST_ID= " + dep + " and OC_PROPERTY_ID= " + P
				+ " and OC_PROPERTY_TOOLS_ID=" + PTOOL;
		if (MIN != "") {
			str = str + " AND VALUE_KEY >=" + MIN;
		}
		if (MAX != "") {
			str = str + " AND VALUE_KEY <=" + MAX;
		}
		list.add(str);
		}
		return list;
	}
	
	private List<String> make_sql_list_for_funtionB_ICE(String s, String hangci,
			String dep, String P, String PTOOL, String MIN, String MAX) {
		List<String> list = new ArrayList();
		String str = "";

		str = "SELECT * from OC_DATE_ICE where DEL='OFF'"
				+ " AND OC_VOYAGE_ID=" + hangci + " and OC_STATION_ID in (" + s
				+ ") and OC_DEPLIST_ID= " + dep + " and OC_PROPERTY_ID= " + P
				+ " and OC_PROPERTY_TOOLS_ID=" + PTOOL;
		if (MIN != "") {
			str = str + " AND VALUE_KEY >=" + MIN;
		}
		if (MAX != "") {
			str = str + " AND VALUE_KEY <=" + MAX;
		}
		list.add(str);
		return list;
	}
	public ActionForward select_zhandian(ActionMapping mapping,
			ActionForm form, HttpServletRequest request,
			HttpServletResponse response) {
		System.out.println("��Ҫ���պ���������Ӧ��վ��");
		String id = request.getParameter("id");
		String hangci = request.getParameter("hangci");
		System.out.println("id=" + id + " hangci=" + hangci);
		List<EntityBeanOc_Station> list = this.service_search
				.Find_Oc_Station_by_oc_voyage_id(Integer.valueOf(hangci));
		request.setAttribute("list", list);
		return mapping.findForward("success");
	}
	public ActionForward select_zhandian_ice(ActionMapping mapping,
			ActionForm form, HttpServletRequest request,
			HttpServletResponse response) {
		String id = request.getParameter("id");
		String hangci = request.getParameter("hangci");
		System.out.println("id=" + id + " hangci=" + hangci);
		List<EntityBeanOc_Station_Ice> list = this.service_search
				.Find_Oc_Station_Ice_by_oc_voyage_id(Integer.valueOf(hangci));
		request.setAttribute("list", list);
		return mapping.findForward("success");
	}
	public ActionForward select_zhandian_pla(ActionMapping mapping,
			ActionForm form, HttpServletRequest request,
			HttpServletResponse response) {
		String id = request.getParameter("id");
		String hangci = request.getParameter("hangci");
		System.out.println("id=" + id + " hangci=" + hangci);
		List<EntityBeanOc_Station_Pla> list = this.service_search
				.Find_Oc_Station_Pla_by_oc_voyage_id(Integer.valueOf(hangci));
		request.setAttribute("list", list);
		return mapping.findForward("success");
	}
	public ActionForward select_zhandian_ben(ActionMapping mapping,
			ActionForm form, HttpServletRequest request,
			HttpServletResponse response) {
		String id = request.getParameter("id");
		String hangci = request.getParameter("hangci");
		System.out.println("id=" + id + " hangci=" + hangci);
		List<EntityBeanOc_Station_Ben> list = this.service_search
				.Find_Oc_Station_Ben_by_oc_voyage_id(Integer.valueOf(hangci));
		request.setAttribute("list", list);
		return mapping.findForward("success");
	}
	
	public ActionForward init_compare_pla(ActionMapping mapping, ActionForm form,
			HttpServletRequest request, HttpServletResponse response) {
		
		Integer i = 7;
		List<EntityBeanOc_Depthlist_Pla> oc_depthlist_pla = this.service_search
				.Find_Oc_Depthlist_Pla();
		List<EntityBeanOc_Boat_Pla> oc_boatlist_pla = this.service_search
				.Find_Oc_Boat_Pla_By_oc_boatkind(i);
		List<EntityBean_Oc_Property_Pla> oc_property_pla = this.service_search
				.Find_EntityBean_Oc_Property_Pla_by_property_kind(i);
		System.out.println(oc_boatlist_pla.size());
		request.setAttribute("oc_boatlist", oc_boatlist_pla);
		request.setAttribute("oc_depthlist", oc_depthlist_pla);
		request.setAttribute("oc_property", oc_property_pla);
		return mapping.findForward("success");
	}
	
	
	public ActionForward init_compare_ben(ActionMapping mapping, ActionForm form,
			HttpServletRequest request, HttpServletResponse response) {
		
		Integer i = 8;
		List<EntityBeanOc_Depthlist_Ben> oc_depthlist_ben = this.service_search
				.Find_Oc_Depthlist_Ben();
		List<EntityBeanOc_Boat_Ben> oc_boatlist_ben = this.service_search
				.Find_Oc_Boat_Ben_By_oc_boatkind(i);
		List<EntityBean_Oc_Property_Ben> oc_property_ben = this.service_search
				.Find_EntityBean_Oc_Property_ben_by_property_kind(i);
		System.out.println(oc_boatlist_ben.size());
		request.setAttribute("oc_boatlist", oc_boatlist_ben);
		request.setAttribute("oc_depthlist", oc_depthlist_ben);
		request.setAttribute("oc_property", oc_property_ben);
		return mapping.findForward("success");
	}
	
	
	
	
	public ActionForward init_compare(ActionMapping mapping, ActionForm form,
			HttpServletRequest request, HttpServletResponse response) {
		System.out.println("Ϊ�Ƚϲ�ѯҳ��������Ӧ������");
		Integer i = 5;
		List<EntityBeanOc_Depthlist> oc_depthlist = this.service_search
				.Find_Oc_Depthlist();
		List<EntityBeanOc_Boat> oc_boatlist = this.service_search
				.Find_Oc_Boat_By_oc_boatkind(i);
		List<EntityBean_Oc_Property> oc_property = this.service_search
				.Find_EntityBean_Oc_Property_by_property_kind(i);
		System.out.println(oc_boatlist.size());
		request.setAttribute("oc_boatlist", oc_boatlist);
		request.setAttribute("oc_depthlist", oc_depthlist);
		request.setAttribute("oc_property", oc_property);// ������Ա���ֵ
		return mapping.findForward("success");
	}
	public ActionForward init_compare_ice(ActionMapping mapping, ActionForm form,
			HttpServletRequest request, HttpServletResponse response) {
		Integer i = 6;
		List<EntityBeanOc_Depthlist_Ice> oc_depthlist = this.service_search
				.Find_EntityBeanOc_Depthlist_Ice();
		List<EntityBeanOc_Boat_Ice> oc_boatlist = this.service_search
				.Find_Oc_Boat_Ice_By_oc_boatkind(i);
		List<EntityBean_Oc_Property_Ice> oc_property = this.service_search
				.Find_EntityBean_Oc_Property_Ice_by_property_kind(i);
		System.out.println(oc_boatlist.size());
		request.setAttribute("oc_boatlist", oc_boatlist);
		request.setAttribute("oc_depthlist", oc_depthlist);
		request.setAttribute("oc_property", oc_property);// ������Ա���ֵ
		return mapping.findForward("success");
	}
	public ActionForward export_xls(ActionMapping mapping, ActionForm form,
			HttpServletRequest request, HttpServletResponse response) {

		System.out.println("开始导向到XLS导出功能");
		DynaActionForm function_searchform1 = (DynaActionForm) form;
		String table_data = function_searchform1.getString("table_data");
		System.out.println("table_data=" + table_data);
		request.setAttribute("table_data", table_data);
		return mapping.findForward("success");
	}

	
	
	
	
	
	
	public ActionForward function4(ActionMapping mapping, ActionForm form,
			HttpServletRequest request, HttpServletResponse response) {
		System.out.println("BEN数据库查询");
		Read_Properties Read_Properties = new Read_Properties(
				"db_cn.properties");
		String ip = Read_Properties.Read_Properties_root("ip");
		String port = Read_Properties.Read_Properties_root("port");
		String service = Read_Properties.Read_Properties_root("servicname");
		String username = Read_Properties.Read_Properties_root("username");
		String password = Read_Properties.Read_Properties_root("password");
		DataBaseConn databaseconn = new DataBaseConn(ip, port, service,
				username, password);

		DynaActionForm function_searchform1 = (DynaActionForm) form;
		String sql = "";
		ResultSet rs = null;
		String oc_tools = function_searchform1.getString("H_oc_tools");
		String oc_max = function_searchform1.getString("H_oc_max");
		String oc_min = function_searchform1.getString("H_oc_min");
		String oc_voyage = function_searchform1.getString("H_oc_voyage");
		String oc_property = function_searchform1.getString("H_oc_property");
		String oc_station = function_searchform1.getString("H_oc_station");
		String oc_depthlist = function_searchform1.getString("H_oc_depthlist");
		String f1 = function_searchform1.getString("f1");
		String f2 = function_searchform1.getString("f2");
		String f3 = function_searchform1.getString("f3");
		String xmldate = "";
		String tabledata = "";

		oc_voyage = cut_tail(oc_voyage);
		oc_property = cut_tail(oc_property);
		oc_station = cut_tail(oc_station);
		oc_depthlist = cut_tail(oc_depthlist);
		System.out.println("oc_voyage=" + oc_voyage);
		System.out.println("oc_property=" + oc_property);
		System.out.println("oc_station=" + oc_station);
		System.out.println("oc_depthlist=" + oc_depthlist);
		System.out.println("oc_max=" + oc_max);
		// oc_max=oc_max.replace("最大值...", "");
		System.out.println("oc_tools=" + oc_tools);
		System.out.println("oc_min=" + oc_min);
		// oc_max=oc_max.replace("最小值...", "");
		System.out.println("f1=" + f1);
		System.out.println("f2=" + f2);
		System.out.println("f3=" + f3);

		if (f1.endsWith("ok") && f2.equals("") && f3.equals("")) {
			System.out.println("单一站点多层深多属性");
			tabledata = "<table width='100%'><tr><td>**单一站点多层深多属性**</td></tr>";

			xmldate = "<chart exportEnabled='1' exportAtClient='1' exportHandler='fcExporter1' caption='**单一站点多层深多属性**' xAxisName='层深'"
					+ " yAxisName='属性值' showValues='0' numberPrefix='value'>";
			sql = "select depth from OC_DEPTHLIST_BEN where id in (" + oc_depthlist
					+ ") and del='OFF' order by depth";
			try {
				rs = databaseconn.getStmt().executeQuery(sql);
				xmldate = xmldate + "<categories>";
				tabledata = tabledata + "<tr>" + "<td>" + "层深/属性" + "</td>";// �����ı��ı?
				while (rs.next()) {
					xmldate = xmldate + "<category label='"
							+ rs.getString("depth") + "(M)' />";
					tabledata = tabledata + "<td>" + rs.getString("depth")
							+ "(M)" + "</td>";
				}
				xmldate = xmldate + "</categories>";
				tabledata = tabledata + "</tr>";
			} catch (SQLException e1) {

				e1.printStackTrace();
			}
			List<EnitityBeanOc_Date_Ben> data = new ArrayList<EnitityBeanOc_Date_Ben>();
			List<Property_Tools_Max_Min> p_list = new ArrayList<Property_Tools_Max_Min>();
			List<String> sql_list = new ArrayList<String>();
			String property[] = oc_property.split(",");
			String tools[] = oc_tools.split(",");
			String max[] = oc_max.split(",");
			String min[] = oc_min.split(",");
			System.out.println("property 长度" + property.length + "tools 长度"
					+ tools.length + "max 长度" + max.length + "min 长度"
					+ min.length);
			for (int i = 0; i < tools.length; i++) {
				Property_Tools_Max_Min p = new Property_Tools_Max_Min();
				p.setMax(max[i]);
				p.setMin(min[i]);
				p.setProperty_id(property[i]);
				p.setTools_id(tools[i]);
				p_list.add(p);
			}
			System.out.println("p_list.size()=" + p_list.size());
			for (int j = 0; j < p_list.size(); j++) {
				System.out.println(p_list.get(j).getMax() + "  "
						+ p_list.get(j).getMin() + "  "
						+ p_list.get(j).getProperty_id() + "  "
						+ p_list.get(j).getTools_id());
				sql = "select * " + " from OC_DATE_BEN WHERE DEL='OFF' "
						+ "AND OC_VOYAGE_ID=" + oc_voyage
						+ " AND OC_STATION_ID IN (" + oc_station + ")"
						+ "AND OC_DEPLIST_ID IN(" + oc_depthlist + ") "
						+ "AND OC_PROPERTY_ID="
						+ p_list.get(j).getProperty_id()
						+ " AND OC_PROPERTY_TOOLS_ID="
						+ p_list.get(j).getTools_id();
				// AND VALUE_KEY >= "+p_list.get(j).getMin()+" AND VALUE_KEY
				// <="+p_list.get(j).getMax()+"
				if (!p_list.get(j).getMin().equals("最小值...")) {
					sql = sql + " AND VALUE_KEY >= " + p_list.get(j).getMin();
				}
				if (!p_list.get(j).getMax().equals("最大值...")) {
					sql = sql + " AND VALUE_KEY <= " + p_list.get(j).getMax();
				}
				sql = sql + " ORDER BY OC_DEPLIST_ID";
				System.out.println("sql=" + sql);
				sql_list.add(sql);
			}
			System.out.println("开始执行SQL的计划");
			for (int i = 0; i < sql_list.size(); i++) {
				try {
					rs = databaseconn.getStmt().executeQuery(sql_list.get(i));
					System.out.println("Sql=" + sql_list.get(i) + "执行完毕");
					while (rs.next()) {
						EnitityBeanOc_Date_Ben e = new EnitityBeanOc_Date_Ben();
						e.setDel(rs.getString("DEL"));
						e.setId(rs.getInt("ID"));
						e.setOc_deplist_id(rs.getInt("OC_DEPLIST_ID"));
						e.setOc_property_id(rs.getInt("OC_PROPERTY_ID"));
						e.setOc_property_tools_id(rs
								.getInt("OC_PROPERTY_TOOLS_ID"));
						e.setOc_station_id(rs.getInt("OC_STATION_ID"));
						e.setOc_voyage_id(rs.getInt("OC_VOYAGE_ID"));
						e.setValue_key(rs.getDouble("VALUE_KEY"));
						data.add(e);
					}
					System.out.println("完成数据的" + data.size());
					if (data.size() > 0) {
						sql = "select PROPERTY_NAME from OC_PROPERTY_BEN where ID="
								+ data.get(0).getOc_property_id();
						rs = databaseconn.getStmt().executeQuery(sql);
						String property_name = "";
						String property_tools = "";
						if (rs.next()) {
							property_name = rs.getString("PROPERTY_NAME");

						}
						sql = "select TOOLS_NAME from OC_PROPERTY_TOOLS_BEN where ID="
								+ data.get(0).getOc_property_tools_id();
						rs = databaseconn.getStmt().executeQuery(sql);
						if (rs.next()) {
							property_tools = rs.getString("TOOLS_NAME");

						}
						xmldate = xmldate + "<dataset seriesName='"
								+ property_name + "(" + property_tools + ")'> ";
						tabledata = tabledata + "<tr><td>" + property_name
								+ "(" + property_tools + ")</td>";

					} else {
						xmldate = xmldate + "<dataset seriesName='" + "位置的属性"
								+ "(" + "位置的工具" + ")'> ";
						tabledata = tabledata + "<tr><td>" + "null" + "("
								+ "null" + ")</td>";
					}
					String d[] = oc_depthlist.split(",");// ת��ʽ���ַ�����
					List<Integer> dep_list = new ArrayList();
					for (int k = 0; k < d.length; k++)// �Բ�������Ϊ��־������ѯ������
					{
						System.out.println("由于数据没有加入一个空值" + d[k] + ",数据的内容");
						String AddEmpty = "yes";
						String value = "";
						for (int j = 0; j < data.size(); j++) {
							if (data.get(j).getOc_deplist_id().toString()
									.equals(d[k])) {
								value = data.get(j).getValue_key().toString();
								AddEmpty = "not";
								break;
							}
						}
						if (AddEmpty.endsWith("yes")) {

							xmldate = xmldate + "<set value='" + "'/>";
							tabledata = tabledata + "<td>" + "null" + "</td>";

						} else {

							xmldate = xmldate + "<set value='" + value + "'/>";
							tabledata = tabledata + "<td>" + value + "</td>";

						}

					}

					
					if (data.size() >= 0) {
						xmldate = xmldate + "</dataset>";
						tabledata = tabledata + "</tr>";
						System.out.println("添加一个尾部数据是的数据完整");
						data.clear();
					}

				} catch (SQLException e) {
					// TODO Auto-generated catch block
					e.printStackTrace();
				}
			}

			xmldate = xmldate
					+ "<styles><definition><style name='CanvasAnim' type='animation' param='_xScale' start='0' duration='1' />"
					+ "</definition><application><apply toObject='Canvas' styles='CanvasAnim' /></application></styles></chart>";
			tabledata = tabledata + "</table>";
			System.out.println("tabledata=" + tabledata);
			System.out.println("xmldate=" + xmldate);

		} else if (f1.endsWith("") && f2.equals("ok") && f3.equals("")) {
			System.out.println("查询模式为多站点多,单一层深,多种属性的查询");
			String dp = "";
			sql = "select * from OC_DEPTHLIST_BEN where DEL='OFF' AND ID="
					+ oc_depthlist;
			try {
				rs = databaseconn.getStmt().executeQuery(sql);

				while (rs.next()) {
					dp = rs.getString("depth");
				}
				tabledata = "<table width='100%'><tr><td>**层深=" + dp
						+ "(M) **</td></tr>";
				xmldate = "<chart exportEnabled='1' exportAtClient='1' exportHandler='fcExporter1' caption='**查询模式为多站点多,单一层深,多种属性。深度="
						+ dp
						+ "(M) **' xAxisName='站点名称'"
						+ " yAxisName='属性值' showValues='0' numberPrefix='value'>";
				sql = "select * from OC_STATION_BEN where DEL='OFF' AND ID IN ("
						+ oc_station + ")";

				rs = databaseconn.getStmt().executeQuery(sql);
				xmldate = xmldate + "<categories>";
				tabledata = tabledata + "<tr>" + "<td>" + "站点/属性" + "</td>";
				while (rs.next()) {
					xmldate = xmldate + "<category label='"
							+ rs.getString("STATION_NAME") + "' />";
					tabledata = tabledata + "<td>"
							+ rs.getString("STATION_NAME") + "</td>";
				}
				xmldate = xmldate + "</categories>";
				tabledata = tabledata + "</tr>";
			} catch (SQLException e1) {

				e1.printStackTrace();
			}
			System.out
					.println("开始配置数据信息");
			List<EnitityBeanOc_Date_Ben> data = new ArrayList<EnitityBeanOc_Date_Ben>();
			List<Property_Tools_Max_Min> p_list = new ArrayList<Property_Tools_Max_Min>();
			List<String> sql_list = new ArrayList<String>();
			String property[] = oc_property.split(",");
			String tools[] = oc_tools.split(",");
			String max[] = oc_max.split(",");
			String min[] = oc_min.split(",");
			System.out.println("property 的长度" + property.length + "tools 工具的"
					+ tools.length + "max 最大值的长度" + max.length + "min 的长度"
					+ min.length);
			for (int i = 0; i < tools.length; i++) {
				Property_Tools_Max_Min p = new Property_Tools_Max_Min();
				p.setMax(max[i]);
				p.setMin(min[i]);
				p.setProperty_id(property[i]);
				p.setTools_id(tools[i]);
				p_list.add(p);
			}
			System.out.println("p_list.size()=" + p_list.size());
			for (int j = 0; j < p_list.size(); j++) {
				System.out.println(p_list.get(j).getMax() + "  "
						+ p_list.get(j).getMin() + "  "
						+ p_list.get(j).getProperty_id() + "  "
						+ p_list.get(j).getTools_id());
				System.out.println("按照属性及工具的情况,从数据库中获取数据值");
				sql = "select * " + " from OC_DATE_BEN WHERE DEL='OFF' "
						+ "AND OC_VOYAGE_ID=" + oc_voyage
						+ " AND OC_STATION_ID IN (" + oc_station + ")"
						+ "AND OC_DEPLIST_ID IN(" + oc_depthlist + ") "
						+ "AND OC_PROPERTY_ID="
						+ p_list.get(j).getProperty_id()
						+ " AND OC_PROPERTY_TOOLS_ID="
						+ p_list.get(j).getTools_id();
				// AND VALUE_KEY >= "+p_list.get(j).getMin()+" AND VALUE_KEY
				// <="+p_list.get(j).getMax()+"
				if (!p_list.get(j).getMin().equals("最小值...")) {
					sql = sql + " AND VALUE_KEY >= " + p_list.get(j).getMin();
				}
				if (!p_list.get(j).getMax().equals("最大值...")) {
					sql = sql + " AND VALUE_KEY <= " + p_list.get(j).getMax();
				}
				sql = sql + " ORDER BY OC_STATION_ID";
				System.out.println("sql=" + sql);
				sql_list.add(sql);
			}

			System.out.println("按照SQL数据列表执行SQL");
			for (int i = 0; i < sql_list.size(); i++) {
				try {
					rs = databaseconn.getStmt().executeQuery(sql_list.get(i));
					System.out.println("SQL语句执行成功 SQL="+sql_list.get(i));
					while (rs.next()) {
						EnitityBeanOc_Date_Ben e = new EnitityBeanOc_Date_Ben();
						e.setDel(rs.getString("DEL"));
						e.setId(rs.getInt("ID"));
						e.setOc_deplist_id(rs.getInt("OC_DEPLIST_ID"));
						e.setOc_property_id(rs.getInt("OC_PROPERTY_ID"));
						e.setOc_property_tools_id(rs
								.getInt("OC_PROPERTY_TOOLS_ID"));
						e.setOc_station_id(rs.getInt("OC_STATION_ID"));
						e.setOc_voyage_id(rs.getInt("OC_VOYAGE_ID"));
						e.setValue_key(rs.getDouble("VALUE_KEY"));
						data.add(e);
					}
					System.out.println("向数据集合添加了一个数据值" + data.size());
					System.out.println("配置属性名称和属性工具名称");
					if (data.size() > 0) {
						sql = "select PROPERTY_NAME from OC_PROPERTY_BEN where ID="
								+ data.get(0).getOc_property_id();
						System.out.println("SQL执行成功" + sql);
						rs = databaseconn.getStmt().executeQuery(sql);
						String property_name = "";
						String property_tools = "";
						if (rs.next()) {
							property_name = rs.getString("PROPERTY_NAME");

						}
						sql = "select TOOLS_NAME from OC_PROPERTY_TOOLS_BEN where ID="
								+ data.get(0).getOc_property_tools_id();
						System.out.println("SQL执行成功" + sql);
						rs = databaseconn.getStmt().executeQuery(sql);
						if (rs.next()) {
							property_tools = rs.getString("TOOLS_NAME");

						}
						xmldate = xmldate + "<dataset seriesName='"
								+ property_name + "(" + property_tools + ")'> ";
						tabledata = tabledata + "<tr><td>" + property_name
								+ "(" + property_tools + ")</td>";

					} else {
						tabledata = tabledata + "<tr><td>" + "null" + "("
								+ "null" + ")</td>";
					}
					String d[] = oc_station.split(",");
					List<Integer> dep_list = new ArrayList();
					for (int k = 0; k < d.length; k++)
					{
						System.out
								.println("识别深度字段的长度在图上配置值  "
										+ d[k]
										+ ",开始鉴别是否有这个值");
						String AddEmpty = "yes";
						String value = "";
						for (int j = 0; j < data.size(); j++) {
							if (data.get(j).getOc_station_id().toString()
									.equals(d[k])) {
								value = data.get(j).getValue_key().toString();
								AddEmpty = "not";
								break;
							}
						}
						if (AddEmpty.endsWith("yes")) {

							xmldate = xmldate + "<set value='" + "'/>";
							tabledata = tabledata + "<td>" + "null" + "</td>";

						} else {

							xmldate = xmldate + "<set value='" + value + "'/>";
							tabledata = tabledata + "<td>" + value + "</td>";

						}
					}
					if (data.size() > 0) {
						xmldate = xmldate + "</dataset>";
						tabledata = tabledata + "</tr>";
						data.clear();
					}

				} catch (SQLException e) {
					// TODO Auto-generated catch block
					e.printStackTrace();
				}
			}

			xmldate = xmldate
					+ "<styles><definition><style name='CanvasAnim' type='animation' param='_xScale' start='0' duration='1' />"
					+ "</definition><application><apply toObject='Canvas' styles='CanvasAnim' /></application></styles></chart>";
			tabledata = tabledata + "</table>";
			System.out.println("tabledata=" + tabledata);
			System.out.println("xmldate=" + xmldate);

		} else if ((f1.endsWith("") && f2.equals("") && f3.equals("ok"))) {
			System.out.println("查询方式为多站点,多层深,单一属性");
			String p_name = "";
			String p_tool = "";
			String max_value = "";
			String min_value = "";
			try {
				sql = "select PROPERTY_NAME from OC_PROPERTY_BEN where ID="
						+ oc_property;

				rs = databaseconn.getStmt().executeQuery(sql);
				if (rs.next()) {
					p_name = rs.getString("PROPERTY_NAME");

				}

				sql = "select TOOLS_NAME from OC_PROPERTY_TOOLS_BEN where ID="
						+ oc_tools;
				rs = databaseconn.getStmt().executeQuery(sql);
				if (rs.next()) {
					p_tool = rs.getString("TOOLS_NAME");

				}
			} catch (SQLException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
			if (oc_max.equals("最大值...")) {
				max_value = "未限定";
			} else {
				max_value = oc_max;
			}
			if (oc_min.equals("最小值...")) {
				min_value = "未限定";
			} else {
				min_value = oc_min;
			}
			tabledata = "<table width='100%'><tr><td>**查询方式为：多站点,多层深,单一属性。属性名称= "
					+ p_name
					+ "属性名称="
					+ p_tool
					+ " 取值区间为 最小值="
					+ min_value
					+ "最大值=" + max_value + "**</td></tr>";

			xmldate = "<chart exportEnabled='1' exportAtClient='1' exportHandler='fcExporter1' caption='**查询方式为：多站点,多层深,单一属性。属性名称="
					+ p_name
					+ "属性工具="
					+ p_tool
					+ " 查询最小值="
					+ min_value
					+ " 查询最大值"
					+ max_value
					+ "**' xAxisName='站点名称'"
					+ " yAxisName='属性名称' showValues='0' numberPrefix='value'>";

			sql = "select * from OC_STATION_BEN where DEL='OFF' AND ID IN ("
					+ oc_station + ")";

			try {
				rs = databaseconn.getStmt().executeQuery(sql);
				xmldate = xmldate + "<categories>";
				tabledata = tabledata + "<tr>" + "<td>" + "深度值/站点名称" + "</td>";// �����ı��ı?
				while (rs.next()) {
					xmldate = xmldate + "<category label='"
							+ rs.getString("STATION_NAME") + "' />";
					tabledata = tabledata + "<td>"
							+ rs.getString("STATION_NAME") + "</td>";
				}
				xmldate = xmldate + "</categories>";
				tabledata = tabledata + "</tr>";
			} catch (SQLException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}

			System.out
					.println("开始从数据库中查询数据");
			List<EnitityBeanOc_Date_Ben> data = new ArrayList<EnitityBeanOc_Date_Ben>();
			List<EntityBeanOc_Depthlist> p_list = new ArrayList<EntityBeanOc_Depthlist>();
			List<String> sql_list = new ArrayList<String>();
			String depth[] = oc_depthlist.split(",");

			System.out.println("depth 深度大小" + depth.length);
			for (int i = 0; i < depth.length; i++) {
				EntityBeanOc_Depthlist p = new EntityBeanOc_Depthlist();
				p.setId(Integer.valueOf(depth[i]));
				p_list.add(p);
			}
			System.out.println("p_list.size()=" + p_list.size());

			for (int j = 0; j < p_list.size(); j++) {
				System.out.println(p_list.get(j).getId());
				System.out.println("查询数据库的值");
				sql = "select * " + " from OC_DATE_BEN WHERE DEL='OFF' "
						+ "AND OC_VOYAGE_ID=" + oc_voyage
						+ " AND OC_STATION_ID IN (" + oc_station + ")"
						+ "AND OC_DEPLIST_ID IN(" + p_list.get(j).getId()
						+ ") " + "AND OC_PROPERTY_ID=" + oc_property
						+ " AND OC_PROPERTY_TOOLS_ID=" + oc_tools;
				// AND VALUE_KEY >= "+p_list.get(j).getMin()+" AND VALUE_KEY
				// <="+p_list.get(j).getMax()+"
				if (!oc_min.equals("最小值...")) {
					sql = sql + " AND VALUE_KEY >= " + oc_min;
				}
				if (!oc_max.equals("最大值...")) {
					sql = sql + " AND VALUE_KEY <= " + oc_max;
				}
				sql = sql + " ORDER BY OC_DEPLIST_ID";
				System.out.println("sql=" + sql);
				sql_list.add(sql);
			}

			System.out.println("开始执行SQL语句");
			for (int i = 0; i < sql_list.size(); i++) {
				try {
					rs = databaseconn.getStmt().executeQuery(sql_list.get(i));
					System.out.println("SQL语句执行通过,SQL="+sql_list.get(i));
					while (rs.next()) {
						EnitityBeanOc_Date_Ben e = new EnitityBeanOc_Date_Ben();
						e.setDel(rs.getString("DEL"));
						e.setId(rs.getInt("ID"));
						e.setOc_deplist_id(rs.getInt("OC_DEPLIST_ID"));
						e.setOc_property_id(rs.getInt("OC_PROPERTY_ID"));
						e.setOc_property_tools_id(rs
								.getInt("OC_PROPERTY_TOOLS_ID"));
						e.setOc_station_id(rs.getInt("OC_STATION_ID"));
						e.setOc_voyage_id(rs.getInt("OC_VOYAGE_ID"));
						e.setValue_key(rs.getDouble("VALUE_KEY"));
						data.add(e);
					}
					System.out.println("查询完成,数据集合大小为=" + data.size());
					if (data.size() > 0) {
						sql = "select depth from OC_DEPTHLIST_BEN where ID="
								+ data.get(0).getOc_deplist_id();
						System.out.println("SQL执行完成" + sql);
						rs = databaseconn.getStmt().executeQuery(sql);
						String depth_name = "";

						if (rs.next()) {
							depth_name = rs.getString("depth");

						}
						xmldate = xmldate + "<dataset seriesName='"
								+ depth_name + "(" + "(M)" + ")'> ";
						tabledata = tabledata + "<tr><td>" + depth_name + "("
								+ "(M)" + ")</td>";

					} else {
						tabledata = tabledata + "<tr><td>" + "null" + "("
								+ "null" + ")</td>";
					}
					String d[] = oc_station.split(",");
					for (int k = 0; k < d.length; k++)
					{
						System.out
								.println("X轴长度按照层深的提交大小来计算,层深共有"
										+ d[k]
										+ ",开始配置数据");
						String AddEmpty = "yes";
						String value = "";
						for (int j = 0; j < data.size(); j++) {
							if (data.get(j).getOc_station_id().toString()
									.equals(d[k])) {
								value = data.get(j).getValue_key().toString();
								AddEmpty = "not";
								break;
							}
						}
						if (AddEmpty.endsWith("yes")) {

							xmldate = xmldate + "<set value='" + "'/>";
							tabledata = tabledata + "<td>" + "null" + "</td>";

						} else {

							xmldate = xmldate + "<set value='" + value + "'/>";
							tabledata = tabledata + "<td>" + value + "</td>";

						}

					}
					if (data.size() > 0) {
						xmldate = xmldate + "</dataset>";
						tabledata = tabledata + "</tr>";
						data.clear();
					}

				} catch (SQLException e) {
					// TODO Auto-generated catch block
					e.printStackTrace();
				}
			}

			xmldate = xmldate
					+ "<styles><definition><style name='CanvasAnim' type='animation' param='_xScale' start='0' duration='1' />"
					+ "</definition><application><apply toObject='Canvas' styles='CanvasAnim' /></application></styles></chart>";
			tabledata = tabledata + "</table>";
			System.out.println("tabledata=" + tabledata);
			System.out.println("xmldate=" + xmldate);

		} else {
			System.out.println("数据查询完成");
		}
		databaseconn = null;
		request.setAttribute("tabledata", tabledata);
		request.setAttribute("xmldate", xmldate);
		return mapping.findForward("success");
	}

	public ActionForward function1(ActionMapping mapping, ActionForm form,
			HttpServletRequest request, HttpServletResponse response) {
		System.out.println("海洋环境数据库查询");
		Read_Properties Read_Properties = new Read_Properties(
				"db_cn.properties");
		String ip = Read_Properties.Read_Properties_root("ip");
		String port = Read_Properties.Read_Properties_root("port");
		String service = Read_Properties.Read_Properties_root("servicname");
		String username = Read_Properties.Read_Properties_root("username");
		String password = Read_Properties.Read_Properties_root("password");
		DataBaseConn databaseconn = new DataBaseConn(ip, port, service,
				username, password);

		DynaActionForm function_searchform1 = (DynaActionForm) form;
		String sql = "";
		ResultSet rs = null;
		String oc_tools = function_searchform1.getString("H_oc_tools");
		String oc_max = function_searchform1.getString("H_oc_max");
		String oc_min = function_searchform1.getString("H_oc_min");
		String oc_voyage = function_searchform1.getString("H_oc_voyage");
		String oc_property = function_searchform1.getString("H_oc_property");
		String oc_station = function_searchform1.getString("H_oc_station");
		String oc_depthlist = function_searchform1.getString("H_oc_depthlist");
		String f1 = function_searchform1.getString("f1");
		String f2 = function_searchform1.getString("f2");
		String f3 = function_searchform1.getString("f3");
		String xmldate = "";
		String tabledata = "";

		oc_voyage = cut_tail(oc_voyage);
		oc_property = cut_tail(oc_property);
		oc_station = cut_tail(oc_station);
		oc_depthlist = cut_tail(oc_depthlist);
		System.out.println("oc_voyage=" + oc_voyage);
		System.out.println("oc_property=" + oc_property);
		System.out.println("oc_station=" + oc_station);
		System.out.println("oc_depthlist=" + oc_depthlist);
		System.out.println("oc_max=" + oc_max);
		// oc_max=oc_max.replace("最大值...", "");
		System.out.println("oc_tools=" + oc_tools);
		System.out.println("oc_min=" + oc_min);
		// oc_max=oc_max.replace("最小值...", "");
		System.out.println("f1=" + f1);
		System.out.println("f2=" + f2);
		System.out.println("f3=" + f3);

		if (f1.endsWith("ok") && f2.equals("") && f3.equals("")) {
			System.out.println("单一站点多层深多属性");
			tabledata = "<table width='100%'><tr><td>**单一站点多层深多属性**</td></tr>";

			xmldate = "<chart exportEnabled='1' exportAtClient='1' exportHandler='fcExporter1' caption='**单一站点多层深多属性**' xAxisName='层深'"
					+ " yAxisName='属性值' showValues='0' numberPrefix='value'>";
			sql = "select depth from OC_DEPTHLIST where id in (" + oc_depthlist
					+ ") and del='OFF' order by depth";
			try {
				rs = databaseconn.getStmt().executeQuery(sql);
				xmldate = xmldate + "<categories>";
				tabledata = tabledata + "<tr>" + "<td>" + "层深/属性" + "</td>";
				while (rs.next()) {
					xmldate = xmldate + "<category label='"
							+ rs.getString("depth") + "(M)' />";
					tabledata = tabledata + "<td>" + rs.getString("depth")
							+ "(M)" + "</td>";
				}
				xmldate = xmldate + "</categories>";
				tabledata = tabledata + "</tr>";
			} catch (SQLException e1) {

				e1.printStackTrace();
			}
			List<EnitityBeanOc_Date_Sur> data = new ArrayList<EnitityBeanOc_Date_Sur>();
			List<Property_Tools_Max_Min> p_list = new ArrayList<Property_Tools_Max_Min>();
			List<String> sql_list = new ArrayList<String>();
			String property[] = oc_property.split(",");
			String tools[] = oc_tools.split(",");
			String max[] = oc_max.split(",");
			String min[] = oc_min.split(",");
			System.out.println("property 长度" + property.length + "tools 长度"
					+ tools.length + "max 长度" + max.length + "min 长度"
					+ min.length);
			for (int i = 0; i < tools.length; i++) {
				Property_Tools_Max_Min p = new Property_Tools_Max_Min();
				p.setMax(max[i]);
				p.setMin(min[i]);
				p.setProperty_id(property[i]);
				p.setTools_id(tools[i]);
				p_list.add(p);
			}
			System.out.println("p_list.size()=" + p_list.size());
			for (int j = 0; j < p_list.size(); j++) {
				System.out.println(p_list.get(j).getMax() + "  "
						+ p_list.get(j).getMin() + "  "
						+ p_list.get(j).getProperty_id() + "  "
						+ p_list.get(j).getTools_id());
				sql = "select * " + " from OC_DATE_SUR WHERE DEL='OFF' "
						+ "AND OC_VOYAGE_ID=" + oc_voyage
						+ " AND OC_STATION_ID IN (" + oc_station + ")"
						+ "AND OC_DEPLIST_ID IN(" + oc_depthlist + ") "
						+ "AND OC_PROPERTY_ID="
						+ p_list.get(j).getProperty_id()
						+ " AND OC_PROPERTY_TOOLS_ID="
						+ p_list.get(j).getTools_id();
				// AND VALUE_KEY >= "+p_list.get(j).getMin()+" AND VALUE_KEY
				// <="+p_list.get(j).getMax()+"
				if (!p_list.get(j).getMin().equals("最小值...")) {
					sql = sql + " AND VALUE_KEY >= " + p_list.get(j).getMin();
				}
				if (!p_list.get(j).getMax().equals("最大值...")) {
					sql = sql + " AND VALUE_KEY <= " + p_list.get(j).getMax();
				}
				sql = sql + " ORDER BY OC_DEPLIST_ID";
				System.out.println("sql=" + sql);
				sql_list.add(sql);
			}
			System.out.println("开始执行SQL的计划");
			for (int i = 0; i < sql_list.size(); i++) {
				try {
					rs = databaseconn.getStmt().executeQuery(sql_list.get(i));
					System.out.println("Sql=" + sql_list.get(i) + "执行完毕");
					while (rs.next()) {
						EnitityBeanOc_Date_Sur e = new EnitityBeanOc_Date_Sur();
						e.setDel(rs.getString("DEL"));
						e.setId(rs.getInt("ID"));
						e.setOc_deplist_id(rs.getInt("OC_DEPLIST_ID"));
						e.setOc_property_id(rs.getInt("OC_PROPERTY_ID"));
						e.setOc_property_tools_id(rs
								.getInt("OC_PROPERTY_TOOLS_ID"));
						e.setOc_station_id(rs.getInt("OC_STATION_ID"));
						e.setOc_voyage_id(rs.getInt("OC_VOYAGE_ID"));
						e.setValue_key(rs.getDouble("VALUE_KEY"));
						data.add(e);
					}
					System.out.println("完成数据的" + data.size());
					if (data.size() > 0) {
						sql = "select PROPERTY_NAME from OC_PROPERTY where ID="
								+ data.get(0).getOc_property_id();
						rs = databaseconn.getStmt().executeQuery(sql);
						String property_name = "";
						String property_tools = "";
						if (rs.next()) {
							property_name = rs.getString("PROPERTY_NAME");

						}
						sql = "select TOOLS_NAME from OC_PROPERTY_TOOLS where ID="
								+ data.get(0).getOc_property_tools_id();
						rs = databaseconn.getStmt().executeQuery(sql);
						if (rs.next()) {
							property_tools = rs.getString("TOOLS_NAME");

						}
						xmldate = xmldate + "<dataset seriesName='"
								+ property_name + "(" + property_tools + ")'> ";
						tabledata = tabledata + "<tr><td>" + property_name
								+ "(" + property_tools + ")</td>";

					} else {
						xmldate = xmldate + "<dataset seriesName='" + "位置的属性"
								+ "(" + "位置的工具" + ")'> ";
						tabledata = tabledata + "<tr><td>" + "null" + "("
								+ "null" + ")</td>";
					}
					String d[] = oc_depthlist.split(",");
					List<Integer> dep_list = new ArrayList();
					for (int k = 0; k < d.length; k++)
					{
						System.out.println("由于数据没有加入一个空值" + d[k] + ",数据的内容");
						String AddEmpty = "yes";
						String value = "";
						for (int j = 0; j < data.size(); j++) {
							if (data.get(j).getOc_deplist_id().toString()
									.equals(d[k])) {
								value = data.get(j).getValue_key().toString();
								AddEmpty = "not";
								break;
							}
						}
						if (AddEmpty.endsWith("yes")) {

							xmldate = xmldate + "<set value='" + "'/>";
							tabledata = tabledata + "<td>" + "null" + "</td>";

						} else {

							xmldate = xmldate + "<set value='" + value + "'/>";
							tabledata = tabledata + "<td>" + value + "</td>";

						}

					}

					
					if (data.size() >= 0) {
						xmldate = xmldate + "</dataset>";
						tabledata = tabledata + "</tr>";
						System.out.println("添加一个尾部数据是的数据完整");
						data.clear();
					}

				} catch (SQLException e) {
					// TODO Auto-generated catch block
					e.printStackTrace();
				}
			}

			xmldate = xmldate
					+ "<styles><definition><style name='CanvasAnim' type='animation' param='_xScale' start='0' duration='1' />"
					+ "</definition><application><apply toObject='Canvas' styles='CanvasAnim' /></application></styles></chart>";
			tabledata = tabledata + "</table>";
			System.out.println("tabledata=" + tabledata);
			System.out.println("xmldate=" + xmldate);

		} else if (f1.endsWith("") && f2.equals("ok") && f3.equals("")) {
			System.out.println("查询模式为多站点多,单一层深,多种属性的查询");
			String dp = "";
			sql = "select * from OC_DEPTHLIST where DEL='OFF' AND ID="
					+ oc_depthlist;
			try {
				rs = databaseconn.getStmt().executeQuery(sql);

				while (rs.next()) {
					dp = rs.getString("depth");
				}
				tabledata = "<table width='100%'><tr><td>**层深=" + dp
						+ "(M) **</td></tr>";
				xmldate = "<chart exportEnabled='1' exportAtClient='1' exportHandler='fcExporter1' caption='**查询模式为多站点多,单一层深,多种属性。深度="
						+ dp
						+ "(M) **' xAxisName='站点名称'"
						+ " yAxisName='属性值' showValues='0' numberPrefix='value'>";
				sql = "select * from OC_STATION where DEL='OFF' AND ID IN ("
						+ oc_station + ")";

				rs = databaseconn.getStmt().executeQuery(sql);
				xmldate = xmldate + "<categories>";
				tabledata = tabledata + "<tr>" + "<td>" + "站点/属性" + "</td>";
				while (rs.next()) {
					xmldate = xmldate + "<category label='"
							+ rs.getString("STATION_NAME") + "' />";
					tabledata = tabledata + "<td>"
							+ rs.getString("STATION_NAME") + "</td>";
				}
				xmldate = xmldate + "</categories>";
				tabledata = tabledata + "</tr>";
			} catch (SQLException e1) {

				e1.printStackTrace();
			}
			System.out
					.println("开始配置数据信息");
			List<EnitityBeanOc_Date_Sur> data = new ArrayList<EnitityBeanOc_Date_Sur>();
			List<Property_Tools_Max_Min> p_list = new ArrayList<Property_Tools_Max_Min>();
			List<String> sql_list = new ArrayList<String>();
			String property[] = oc_property.split(",");
			String tools[] = oc_tools.split(",");
			String max[] = oc_max.split(",");
			String min[] = oc_min.split(",");
			System.out.println("property 的长度" + property.length + "tools 工具的"
					+ tools.length + "max 最大值的长度" + max.length + "min 的长度"
					+ min.length);
			for (int i = 0; i < tools.length; i++) {
				Property_Tools_Max_Min p = new Property_Tools_Max_Min();
				p.setMax(max[i]);
				p.setMin(min[i]);
				p.setProperty_id(property[i]);
				p.setTools_id(tools[i]);
				p_list.add(p);
			}
			System.out.println("p_list.size()=" + p_list.size());
			for (int j = 0; j < p_list.size(); j++) {
				System.out.println(p_list.get(j).getMax() + "  "
						+ p_list.get(j).getMin() + "  "
						+ p_list.get(j).getProperty_id() + "  "
						+ p_list.get(j).getTools_id());
				System.out.println("按照属性及工具的情况,从数据库中获取数据值");
				sql = "select * " + " from OC_DATE_SUR WHERE DEL='OFF' "
						+ "AND OC_VOYAGE_ID=" + oc_voyage
						+ " AND OC_STATION_ID IN (" + oc_station + ")"
						+ "AND OC_DEPLIST_ID IN(" + oc_depthlist + ") "
						+ "AND OC_PROPERTY_ID="
						+ p_list.get(j).getProperty_id()
						+ " AND OC_PROPERTY_TOOLS_ID="
						+ p_list.get(j).getTools_id();
				// AND VALUE_KEY >= "+p_list.get(j).getMin()+" AND VALUE_KEY
				// <="+p_list.get(j).getMax()+"
				if (!p_list.get(j).getMin().equals("最小值...")) {
					sql = sql + " AND VALUE_KEY >= " + p_list.get(j).getMin();
				}
				if (!p_list.get(j).getMax().equals("最大值...")) {
					sql = sql + " AND VALUE_KEY <= " + p_list.get(j).getMax();
				}
				sql = sql + " ORDER BY OC_STATION_ID";
				System.out.println("sql=" + sql);
				sql_list.add(sql);
			}

			System.out.println("按照SQL数据列表执行SQL");
			for (int i = 0; i < sql_list.size(); i++) {
				try {
					rs = databaseconn.getStmt().executeQuery(sql_list.get(i));
					System.out.println("SQL语句执行成功 SQL="+sql_list.get(i));
					while (rs.next()) {
						EnitityBeanOc_Date_Sur e = new EnitityBeanOc_Date_Sur();
						e.setDel(rs.getString("DEL"));
						e.setId(rs.getInt("ID"));
						e.setOc_deplist_id(rs.getInt("OC_DEPLIST_ID"));
						e.setOc_property_id(rs.getInt("OC_PROPERTY_ID"));
						e.setOc_property_tools_id(rs
								.getInt("OC_PROPERTY_TOOLS_ID"));
						e.setOc_station_id(rs.getInt("OC_STATION_ID"));
						e.setOc_voyage_id(rs.getInt("OC_VOYAGE_ID"));
						e.setValue_key(rs.getDouble("VALUE_KEY"));
						data.add(e);
					}
					System.out.println("向数据集合添加了一个数据值" + data.size());
					System.out.println("配置属性名称和属性工具名称");
					if (data.size() > 0) {
						sql = "select PROPERTY_NAME from OC_PROPERTY where ID="
								+ data.get(0).getOc_property_id();
						System.out.println("SQL执行成功" + sql);
						rs = databaseconn.getStmt().executeQuery(sql);
						String property_name = "";
						String property_tools = "";
						if (rs.next()) {
							property_name = rs.getString("PROPERTY_NAME");

						}
						sql = "select TOOLS_NAME from OC_PROPERTY_TOOLS where ID="
								+ data.get(0).getOc_property_tools_id();
						System.out.println("SQL执行成功" + sql);
						rs = databaseconn.getStmt().executeQuery(sql);
						if (rs.next()) {
							property_tools = rs.getString("TOOLS_NAME");

						}
						xmldate = xmldate + "<dataset seriesName='"
								+ property_name + "(" + property_tools + ")'> ";
						tabledata = tabledata + "<tr><td>" + property_name
								+ "(" + property_tools + ")</td>";

					} else {
						tabledata = tabledata + "<tr><td>" + "null" + "("
								+ "null" + ")</td>";
					}
					String d[] = oc_station.split(",");
					List<Integer> dep_list = new ArrayList();
					for (int k = 0; k < d.length; k++)
					{
						System.out
								.println("识别深度字段的长度在图上配置值  "
										+ d[k]
										+ ",开始鉴别是否有这个值");
						String AddEmpty = "yes";
						String value = "";
						for (int j = 0; j < data.size(); j++) {
							if (data.get(j).getOc_station_id().toString()
									.equals(d[k])) {
								value = data.get(j).getValue_key().toString();
								AddEmpty = "not";
								break;
							}
						}
						if (AddEmpty.endsWith("yes")) {

							xmldate = xmldate + "<set value='" + "'/>";
							tabledata = tabledata + "<td>" + "null" + "</td>";

						} else {

							xmldate = xmldate + "<set value='" + value + "'/>";
							tabledata = tabledata + "<td>" + value + "</td>";

						}
					}
					if (data.size() > 0) {
						xmldate = xmldate + "</dataset>";
						tabledata = tabledata + "</tr>";
						data.clear();
					}

				} catch (SQLException e) {
					// TODO Auto-generated catch block
					e.printStackTrace();
				}
			}

			xmldate = xmldate
					+ "<styles><definition><style name='CanvasAnim' type='animation' param='_xScale' start='0' duration='1' />"
					+ "</definition><application><apply toObject='Canvas' styles='CanvasAnim' /></application></styles></chart>";
			tabledata = tabledata + "</table>";
			System.out.println("tabledata=" + tabledata);
			System.out.println("xmldate=" + xmldate);

		} else if ((f1.endsWith("") && f2.equals("") && f3.equals("ok"))) {
			System.out.println("查询方式为多站点,多层深,单一属性");
			String p_name = "";
			String p_tool = "";
			String max_value = "";
			String min_value = "";
			try {
				sql = "select PROPERTY_NAME from OC_PROPERTY where ID="
						+ oc_property;

				rs = databaseconn.getStmt().executeQuery(sql);
				if (rs.next()) {
					p_name = rs.getString("PROPERTY_NAME");

				}

				sql = "select TOOLS_NAME from OC_PROPERTY_TOOLS where ID="
						+ oc_tools;
				rs = databaseconn.getStmt().executeQuery(sql);
				if (rs.next()) {
					p_tool = rs.getString("TOOLS_NAME");

				}
			} catch (SQLException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
			if (oc_max.equals("最大值...")) {
				max_value = "未限定";
			} else {
				max_value = oc_max;
			}
			if (oc_min.equals("最小值...")) {
				min_value = "未限定";
			} else {
				min_value = oc_min;
			}
			tabledata = "<table width='100%'><tr><td>**查询方式为：多站点,多层深,单一属性。属性名称= "
					+ p_name
					+ "属性名称="
					+ p_tool
					+ " 取值区间为 最小值="
					+ min_value
					+ "最大值=" + max_value + "**</td></tr>";

			xmldate = "<chart exportEnabled='1' exportAtClient='1' exportHandler='fcExporter1' caption='**查询方式为：多站点,多层深,单一属性。属性名称="
					+ p_name
					+ "属性工具="
					+ p_tool
					+ " 查询最小值="
					+ min_value
					+ " 查询最大值"
					+ max_value
					+ "**' xAxisName='站点名称'"
					+ " yAxisName='属性名称' showValues='0' numberPrefix='value'>";

			sql = "select * from OC_STATION where DEL='OFF' AND ID IN ("
					+ oc_station + ")";

			try {
				rs = databaseconn.getStmt().executeQuery(sql);
				xmldate = xmldate + "<categories>";
				tabledata = tabledata + "<tr>" + "<td>" + "深度值/站点名称" + "</td>";
				while (rs.next()) {
					xmldate = xmldate + "<category label='"
							+ rs.getString("STATION_NAME") + "' />";
					tabledata = tabledata + "<td>"
							+ rs.getString("STATION_NAME") + "</td>";
				}
				xmldate = xmldate + "</categories>";
				tabledata = tabledata + "</tr>";
			} catch (SQLException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}

			System.out
					.println("开始从数据库中查询数据");
			List<EnitityBeanOc_Date_Sur> data = new ArrayList<EnitityBeanOc_Date_Sur>();
			List<EntityBeanOc_Depthlist> p_list = new ArrayList<EntityBeanOc_Depthlist>();
			List<String> sql_list = new ArrayList<String>();
			String depth[] = oc_depthlist.split(",");

			System.out.println("depth 深度大小" + depth.length);
			for (int i = 0; i < depth.length; i++) {
				EntityBeanOc_Depthlist p = new EntityBeanOc_Depthlist();
				p.setId(Integer.valueOf(depth[i]));
				p_list.add(p);
			}
			System.out.println("p_list.size()=" + p_list.size());

			for (int j = 0; j < p_list.size(); j++) {
				System.out.println(p_list.get(j).getId());
				System.out.println("查询数据库的值");
				sql = "select * " + " from OC_DATE_SUR WHERE DEL='OFF' "
						+ "AND OC_VOYAGE_ID=" + oc_voyage
						+ " AND OC_STATION_ID IN (" + oc_station + ")"
						+ "AND OC_DEPLIST_ID IN(" + p_list.get(j).getId()
						+ ") " + "AND OC_PROPERTY_ID=" + oc_property
						+ " AND OC_PROPERTY_TOOLS_ID=" + oc_tools;
				// AND VALUE_KEY >= "+p_list.get(j).getMin()+" AND VALUE_KEY
				// <="+p_list.get(j).getMax()+"
				if (!oc_min.equals("最小值...")) {
					sql = sql + " AND VALUE_KEY >= " + oc_min;
				}
				if (!oc_max.equals("最大值...")) {
					sql = sql + " AND VALUE_KEY <= " + oc_max;
				}
				sql = sql + " ORDER BY OC_DEPLIST_ID";
				System.out.println("sql=" + sql);
				sql_list.add(sql);
			}

			System.out.println("开始执行SQL语句");
			for (int i = 0; i < sql_list.size(); i++) {
				try {
					rs = databaseconn.getStmt().executeQuery(sql_list.get(i));
					System.out.println("SQL语句执行通过,SQL="+sql_list.get(i));
					while (rs.next()) {
						EnitityBeanOc_Date_Sur e = new EnitityBeanOc_Date_Sur();
						e.setDel(rs.getString("DEL"));
						e.setId(rs.getInt("ID"));
						e.setOc_deplist_id(rs.getInt("OC_DEPLIST_ID"));
						e.setOc_property_id(rs.getInt("OC_PROPERTY_ID"));
						e.setOc_property_tools_id(rs
								.getInt("OC_PROPERTY_TOOLS_ID"));
						e.setOc_station_id(rs.getInt("OC_STATION_ID"));
						e.setOc_voyage_id(rs.getInt("OC_VOYAGE_ID"));
						e.setValue_key(rs.getDouble("VALUE_KEY"));
						data.add(e);
					}
					System.out.println("查询完成,数据集合大小为=" + data.size());
					if (data.size() > 0) {
						sql = "select depth from OC_DEPTHLIST where ID="
								+ data.get(0).getOc_deplist_id();
						System.out.println("SQL执行完成" + sql);
						rs = databaseconn.getStmt().executeQuery(sql);
						String depth_name = "";

						if (rs.next()) {
							depth_name = rs.getString("depth");

						}
						xmldate = xmldate + "<dataset seriesName='"
								+ depth_name + "(" + "(M)" + ")'> ";
						tabledata = tabledata + "<tr><td>" + depth_name + "("
								+ "(M)" + ")</td>";

					} else {
						tabledata = tabledata + "<tr><td>" + "null" + "("
								+ "null" + ")</td>";
					}
					String d[] = oc_station.split(",");
					for (int k = 0; k < d.length; k++)
					{
						System.out
								.println("X轴长度按照层深的提交大小来计算,层深共有"
										+ d[k]
										+ ",开始配置数据");
						String AddEmpty = "yes";
						String value = "";
						for (int j = 0; j < data.size(); j++) {
							if (data.get(j).getOc_station_id().toString()
									.equals(d[k])) {
								value = data.get(j).getValue_key().toString();
								AddEmpty = "not";
								break;
							}
						}
						if (AddEmpty.endsWith("yes")) {

							xmldate = xmldate + "<set value='" + "'/>";
							tabledata = tabledata + "<td>" + "null" + "</td>";

						} else {

							xmldate = xmldate + "<set value='" + value + "'/>";
							tabledata = tabledata + "<td>" + value + "</td>";

						}

					}
					if (data.size() > 0) {
						xmldate = xmldate + "</dataset>";
						tabledata = tabledata + "</tr>";
						data.clear();
					}

				} catch (SQLException e) {
					// TODO Auto-generated catch block
					e.printStackTrace();
				}
			}

			xmldate = xmldate
					+ "<styles><definition><style name='CanvasAnim' type='animation' param='_xScale' start='0' duration='1' />"
					+ "</definition><application><apply toObject='Canvas' styles='CanvasAnim' /></application></styles></chart>";
			tabledata = tabledata + "</table>";
			System.out.println("tabledata=" + tabledata);
			System.out.println("xmldate=" + xmldate);

		} else {
			System.out.println("数据查询完成");
		}
		databaseconn = null;
		request.setAttribute("tabledata", tabledata);
		request.setAttribute("xmldate", xmldate);
		return mapping.findForward("success");
	}

	
	
	
	public ActionForward function2(ActionMapping mapping, ActionForm form,
			HttpServletRequest request, HttpServletResponse response) {
		System.out.println("开始查询PLA数据");
		Read_Properties Read_Properties = new Read_Properties(
				"db_cn.properties");
		String ip = Read_Properties.Read_Properties_root("ip");
		String port = Read_Properties.Read_Properties_root("port");
		String service = Read_Properties.Read_Properties_root("servicname");
		String username = Read_Properties.Read_Properties_root("username");
		String password = Read_Properties.Read_Properties_root("password");
		DataBaseConn databaseconn = new DataBaseConn(ip, port, service,
				username, password);

		DynaActionForm function_searchform1 = (DynaActionForm) form;
		String sql = "";
		ResultSet rs = null;
		String oc_tools = function_searchform1.getString("H_oc_tools");
		String oc_max = function_searchform1.getString("H_oc_max");
		String oc_min = function_searchform1.getString("H_oc_min");
		String oc_voyage = function_searchform1.getString("H_oc_voyage");
		String oc_property = function_searchform1.getString("H_oc_property");
		String oc_station = function_searchform1.getString("H_oc_station");
		String oc_depthlist = function_searchform1.getString("H_oc_depthlist");
		String f1 = function_searchform1.getString("f1");
		String f2 = function_searchform1.getString("f2");
		String f3 = function_searchform1.getString("f3");
		String xmldate = "";
		String tabledata = "";

		oc_voyage = cut_tail(oc_voyage);
		oc_property = cut_tail(oc_property);
		oc_station = cut_tail(oc_station);
		oc_depthlist = cut_tail(oc_depthlist);
		System.out.println("oc_voyage=" + oc_voyage);
		System.out.println("oc_property=" + oc_property);
		System.out.println("oc_station=" + oc_station);
		System.out.println("oc_depthlist=" + oc_depthlist);
		System.out.println("oc_max=" + oc_max);
		// oc_max=oc_max.replace("最大值...", "");
		System.out.println("oc_tools=" + oc_tools);
		System.out.println("oc_min=" + oc_min);
		// oc_max=oc_max.replace("最小值...", "");
		System.out.println("f1=" + f1);
		System.out.println("f2=" + f2);
		System.out.println("f3=" + f3);

		if (f1.endsWith("ok") && f2.equals("") && f3.equals("")) {
			System.out.println("单一站点多层深多属性");
			tabledata = "<table width='100%'><tr><td>**单一站点多层深多属性**</td></tr>";

			xmldate = "<chart exportEnabled='1' exportAtClient='1' exportHandler='fcExporter1' caption='**单一站点多层深多属性**' xAxisName='层深'"
					+ " yAxisName='属性值' showValues='0' numberPrefix='value'>";
			sql = "select depth from OC_DEPTHLIST_PLA where id in (" + oc_depthlist
					+ ") and del='OFF' order by depth";
			try {
				rs = databaseconn.getStmt().executeQuery(sql);
				xmldate = xmldate + "<categories>";
				tabledata = tabledata + "<tr>" + "<td>" + "层深/属性" + "</td>";// �����ı��ı?
				while (rs.next()) {
					xmldate = xmldate + "<category label='"
							+ rs.getString("depth") + "(M)' />";
					tabledata = tabledata + "<td>" + rs.getString("depth")
							+ "(M)" + "</td>";
				}
				xmldate = xmldate + "</categories>";
				tabledata = tabledata + "</tr>";
			} catch (SQLException e1) {

				e1.printStackTrace();
			}
			List<EnitityBeanOc_Date_Pla> data = new ArrayList<EnitityBeanOc_Date_Pla>();
			List<Property_Tools_Max_Min> p_list = new ArrayList<Property_Tools_Max_Min>();
			List<String> sql_list = new ArrayList<String>();
			String property[] = oc_property.split(",");
			String tools[] = oc_tools.split(",");
			String max[] = oc_max.split(",");
			String min[] = oc_min.split(",");
			System.out.println("property ����" + property.length + "tools ����"
					+ tools.length + "max ����" + max.length + "min ����"
					+ min.length);
			for (int i = 0; i < tools.length; i++) {
				Property_Tools_Max_Min p = new Property_Tools_Max_Min();
				p.setMax(max[i]);
				p.setMin(min[i]);
				p.setProperty_id(property[i]);
				p.setTools_id(tools[i]);
				p_list.add(p);
			}
			System.out.println("p_list.size()=" + p_list.size());
			for (int j = 0; j < p_list.size(); j++) {
				System.out.println(p_list.get(j).getMax() + "  "
						+ p_list.get(j).getMin() + "  "
						+ p_list.get(j).getProperty_id() + "  "
						+ p_list.get(j).getTools_id());
				sql = "select * " + " from OC_DATE_PLA WHERE DEL='OFF' "
						+ "AND OC_VOYAGE_ID=" + oc_voyage
						+ " AND OC_STATION_ID IN (" + oc_station + ")"
						+ "AND OC_DEPLIST_ID IN(" + oc_depthlist + ") "
						+ "AND OC_PROPERTY_ID="
						+ p_list.get(j).getProperty_id()
						+ " AND OC_PROPERTY_TOOLS_ID="
						+ p_list.get(j).getTools_id();
				// AND VALUE_KEY >= "+p_list.get(j).getMin()+" AND VALUE_KEY
				// <="+p_list.get(j).getMax()+"
				if (!p_list.get(j).getMin().equals("最小值...")) {
					sql = sql + " AND VALUE_KEY >= " + p_list.get(j).getMin();
				}
				if (!p_list.get(j).getMax().equals("最大值...")) {
					sql = sql + " AND VALUE_KEY <= " + p_list.get(j).getMax();
				}
				sql = sql + " ORDER BY OC_DEPLIST_ID";
				System.out.println("sql=" + sql);
				sql_list.add(sql);
			}
			System.out.println("开始执行SQL的计划");
			for (int i = 0; i < sql_list.size(); i++) {
				try {
					rs = databaseconn.getStmt().executeQuery(sql_list.get(i));
					System.out.println("Sql=" + sql_list.get(i) + "执行完毕");
					while (rs.next()) {
						EnitityBeanOc_Date_Pla e = new EnitityBeanOc_Date_Pla();
						e.setDel(rs.getString("DEL"));
						e.setId(rs.getInt("ID"));
						e.setOc_deplist_id(rs.getInt("OC_DEPLIST_ID"));
						e.setOc_property_id(rs.getInt("OC_PROPERTY_ID"));
						e.setOc_property_tools_id(rs
								.getInt("OC_PROPERTY_TOOLS_ID"));
						e.setOc_station_id(rs.getInt("OC_STATION_ID"));
						e.setOc_voyage_id(rs.getInt("OC_VOYAGE_ID"));
						e.setValue_key(rs.getDouble("VALUE_KEY"));
						data.add(e);
					}
					System.out.println("完成数据的" + data.size());
					if (data.size() > 0) {
						sql = "select PROPERTY_NAME from OC_PROPERTY_PLA where ID="
								+ data.get(0).getOc_property_id();
						rs = databaseconn.getStmt().executeQuery(sql);
						String property_name = "";
						String property_tools = "";
						if (rs.next()) {
							property_name = rs.getString("PROPERTY_NAME");

						}
						sql = "select TOOLS_NAME from OC_PROPERTY_TOOLS_PLA where ID="
								+ data.get(0).getOc_property_tools_id();
						rs = databaseconn.getStmt().executeQuery(sql);
						if (rs.next()) {
							property_tools = rs.getString("TOOLS_NAME");

						}
						xmldate = xmldate + "<dataset seriesName='"
								+ property_name + "(" + property_tools + ")'> ";
						tabledata = tabledata + "<tr><td>" + property_name
								+ "(" + property_tools + ")</td>";

					} else {
						xmldate = xmldate + "<dataset seriesName='" + "位置的属性"
								+ "(" + "位置的工具" + ")'> ";
						tabledata = tabledata + "<tr><td>" + "null" + "("
								+ "null" + ")</td>";
					}
					String d[] = oc_depthlist.split(",");// ת��ʽ���ַ�����
					List<Integer> dep_list = new ArrayList();
					for (int k = 0; k < d.length; k++)// �Բ�������Ϊ��־������ѯ������
					{
						System.out.println("由于数据没有加入一个空值" + d[k] + ",数据的内容");
						String AddEmpty = "yes";
						String value = "";
						for (int j = 0; j < data.size(); j++) {
							if (data.get(j).getOc_deplist_id().toString()
									.equals(d[k])) {
								value = data.get(j).getValue_key().toString();
								AddEmpty = "not";
								break;
							}
						}
						if (AddEmpty.endsWith("yes")) {

							xmldate = xmldate + "<set value='" + "'/>";
							tabledata = tabledata + "<td>" + "null" + "</td>";

						} else {

							xmldate = xmldate + "<set value='" + value + "'/>";
							tabledata = tabledata + "<td>" + value + "</td>";

						}

					}

					/*
					 * for (int j = 0; j < data.size(); j++)//�˴�Ϊ�ж�һ�� {
					 * 
					 * //��Ҫ�������ж� ����ֵ �� �����ƥ��̶� �Ӷ���뵽���λ��
					 * System.out.println("��ʾ��ѯ��¼�в��������ֵ"
					 * +data.get(j).getOc_deplist_id()); xmldate = xmldate +
					 * "<set value='" + data.get(j).getValue_key() + "'/>";
					 * tabledata
					 * =tabledata+"<td>"+data.get(j).getValue_key()+"</td>"; }
					 */
					if (data.size() >= 0) {
						xmldate = xmldate + "</dataset>";
						tabledata = tabledata + "</tr>";
						System.out.println("添加一个尾部数据是的数据完整");
						data.clear();
					}

				} catch (SQLException e) {
					// TODO Auto-generated catch block
					e.printStackTrace();
				}
			}

			xmldate = xmldate
					+ "<styles><definition><style name='CanvasAnim' type='animation' param='_xScale' start='0' duration='1' />"
					+ "</definition><application><apply toObject='Canvas' styles='CanvasAnim' /></application></styles></chart>";
			tabledata = tabledata + "</table>";
			System.out.println("tabledata=" + tabledata);
			System.out.println("xmldate=" + xmldate);

		} else if (f1.endsWith("") && f2.equals("ok") && f3.equals("")) {
			System.out.println("ѡ���˵�һ�Ĳ���");
			String dp = "";
			sql = "select * from OC_DEPTHLIST_PLA where DEL='OFF' AND ID="
					+ oc_depthlist;
			try {
				rs = databaseconn.getStmt().executeQuery(sql);

				while (rs.next()) {
					dp = rs.getString("depth");
				}
			/*	tabledata = "<table width='100%'><tr><td>**�=" + dp
						+ "(M) ��ѯ**</td></tr>";
				xmldate = "<chart exportEnabled='1' exportAtClient='1' exportHandler='fcExporter1' caption='**����һ��ȡ����������ԡ�����վ�㡿���="
						+ dp
						+ "(M) ��ѯ**' xAxisName='层深'"
						+ " yAxisName='值' showValues='0' numberPrefix='value'>";*/
				tabledata = "<table width='100%'><tr><td>**层深=" + dp
				+ "(M) **</td></tr>";
		xmldate = "<chart exportEnabled='1' exportAtClient='1' exportHandler='fcExporter1' caption='**查询模式为多站点多,单一层深,多种属性。深度="
				+ dp
				+ "(M) **' xAxisName='站点名称'"
				+ " yAxisName='属性值' showValues='0' numberPrefix='value'>";
				
				
				
				sql = "select * from OC_STATION_PLA where DEL='OFF' AND ID IN ("
						+ oc_station + ")";

				rs = databaseconn.getStmt().executeQuery(sql);
				xmldate = xmldate + "<categories>";
				tabledata = tabledata + "<tr>" + "<td>" + "属性/站点" + "</td>";// �����ı��ı?
				while (rs.next()) {
					xmldate = xmldate + "<category label='"
							+ rs.getString("STATION_NAME") + "' />";
					tabledata = tabledata + "<td>"
							+ rs.getString("STATION_NAME") + "</td>";
				}
				xmldate = xmldate + "</categories>";
				tabledata = tabledata + "</tr>";
			} catch (SQLException e1) {

				e1.printStackTrace();
			}
			System.out
					.println("������,����,������Сֵ��ϳ���Ӧ�ļ��ϣ����վ������Ӧ�Ĳ�ѯ");
			List<EnitityBeanOc_Date_Pla> data = new ArrayList<EnitityBeanOc_Date_Pla>();
			List<Property_Tools_Max_Min> p_list = new ArrayList<Property_Tools_Max_Min>();
			List<String> sql_list = new ArrayList<String>();
			String property[] = oc_property.split(",");
			String tools[] = oc_tools.split(",");
			String max[] = oc_max.split(",");
			String min[] = oc_min.split(",");
			System.out.println("property ����" + property.length + "tools ����"
					+ tools.length + "max ����" + max.length + "min ����"
					+ min.length);
			for (int i = 0; i < tools.length; i++) {
				Property_Tools_Max_Min p = new Property_Tools_Max_Min();
				p.setMax(max[i]);
				p.setMin(min[i]);
				p.setProperty_id(property[i]);
				p.setTools_id(tools[i]);
				p_list.add(p);
			}
			System.out.println("p_list.size()=" + p_list.size());
			for (int j = 0; j < p_list.size(); j++) {
				System.out.println(p_list.get(j).getMax() + "  "
						+ p_list.get(j).getMin() + "  "
						+ p_list.get(j).getProperty_id() + "  "
						+ p_list.get(j).getTools_id());
				System.out.println("��ʼƴ����Ӧ��SQL���");
				sql = "select * " + " from OC_DATE_PLA WHERE DEL='OFF' "
						+ "AND OC_VOYAGE_ID=" + oc_voyage
						+ " AND OC_STATION_ID IN (" + oc_station + ")"
						+ "AND OC_DEPLIST_ID IN(" + oc_depthlist + ") "
						+ "AND OC_PROPERTY_ID="
						+ p_list.get(j).getProperty_id()
						+ " AND OC_PROPERTY_TOOLS_ID="
						+ p_list.get(j).getTools_id();
				// AND VALUE_KEY >= "+p_list.get(j).getMin()+" AND VALUE_KEY
				// <="+p_list.get(j).getMax()+"
				if (!p_list.get(j).getMin().equals("最小值...")) {
					sql = sql + " AND VALUE_KEY >= " + p_list.get(j).getMin();
				}
				if (!p_list.get(j).getMax().equals("最大值...")) {
					sql = sql + " AND VALUE_KEY <= " + p_list.get(j).getMax();
				}
				sql = sql + " ORDER BY OC_STATION_ID";
				System.out.println("sql=" + sql);
				sql_list.add(sql);
			}

			System.out.println("ִ����ݿ����....");
			for (int i = 0; i < sql_list.size(); i++) {
				try {
					rs = databaseconn.getStmt().executeQuery(sql_list.get(i));
					System.out.println("���ִ�гɹ�");
					while (rs.next()) {// ��ȡ��ݿ���ݵ��������Ա㴦�?
						EnitityBeanOc_Date_Pla e = new EnitityBeanOc_Date_Pla();
						e.setDel(rs.getString("DEL"));
						e.setId(rs.getInt("ID"));
						e.setOc_deplist_id(rs.getInt("OC_DEPLIST_ID"));
						e.setOc_property_id(rs.getInt("OC_PROPERTY_ID"));
						e.setOc_property_tools_id(rs
								.getInt("OC_PROPERTY_TOOLS_ID"));
						e.setOc_station_id(rs.getInt("OC_STATION_ID"));
						e.setOc_voyage_id(rs.getInt("OC_VOYAGE_ID"));
						e.setValue_key(rs.getDouble("VALUE_KEY"));
						data.add(e);// ��ͬ�ֵĲ��������Ϊ��ݵĲ������Ե��� data
									// �ĳ��ȺͲ���ĳ��Ȳ����
					}
					System.out.println("��ݼ��ϵĴ�С=" + data.size());
					System.out.println("��ʼƴ����Ӧ�� XML���....");
					if (data.size() > 0) {
						sql = "select PROPERTY_NAME from OC_PROPERTY_PLA where ID="
								+ data.get(0).getOc_property_id();
						System.out.println("��ѯ�������sql" + sql);
						rs = databaseconn.getStmt().executeQuery(sql);
						String property_name = "";
						String property_tools = "";
						if (rs.next()) {
							property_name = rs.getString("PROPERTY_NAME");

						}
						sql = "select TOOLS_NAME from OC_PROPERTY_TOOLS_PLA where ID="
								+ data.get(0).getOc_property_tools_id();
						System.out.println("��ѯ���Թ������sql" + sql);
						rs = databaseconn.getStmt().executeQuery(sql);
						if (rs.next()) {
							property_tools = rs.getString("TOOLS_NAME");

						}
						xmldate = xmldate + "<dataset seriesName='"
								+ property_name + "(" + property_tools + ")'> ";
						tabledata = tabledata + "<tr><td>" + property_name
								+ "(" + property_tools + ")</td>";

					} else {
						tabledata = tabledata + "<tr><td>" + "null" + "("
								+ "null" + ")</td>";
					}
					String d[] = oc_station.split(",");// ת��ʽ���ַ�����
					List<Integer> dep_list = new ArrayList();
					for (int k = 0; k < d.length; k++)// �Բ�������Ϊ��־������ѯ������
					{
						System.out
								.println("��ʾ��ѯ��¼�в��������ֵ"
										+ d[k]
										+ ",ѭ�������ݽ���е�ֵ��������������Ч��� ��û�з�������ӿ���ֵ");
						String AddEmpty = "yes";
						String value = "";
						for (int j = 0; j < data.size(); j++) {
							if (data.get(j).getOc_station_id().toString()
									.equals(d[k])) {
								value = data.get(j).getValue_key().toString();
								AddEmpty = "not";
								break;
							}
						}
						if (AddEmpty.endsWith("yes")) {

							xmldate = xmldate + "<set value='" + "'/>";
							tabledata = tabledata + "<td>" + "null" + "</td>";

						} else {

							xmldate = xmldate + "<set value='" + value + "'/>";
							tabledata = tabledata + "<td>" + value + "</td>";

						}

					}

					/*
					 * for (int j = 0; j < data.size(); j++)//�˴�Ϊ�ж�һ�� {
					 * 
					 * //��Ҫ�������ж� ����ֵ �� �����ƥ��̶� �Ӷ���뵽���λ��
					 * System.out.println("��ʾ��ѯ��¼�в��������ֵ"
					 * +data.get(j).getOc_deplist_id()); xmldate = xmldate +
					 * "<set value='" + data.get(j).getValue_key() + "'/>";
					 * tabledata
					 * =tabledata+"<td>"+data.get(j).getValue_key()+"</td>"; }
					 */
					if (data.size() > 0) {
						xmldate = xmldate + "</dataset>";
						tabledata = tabledata + "</tr>";
						data.clear();
					}

				} catch (SQLException e) {
					// TODO Auto-generated catch block
					e.printStackTrace();
				}
			}

			xmldate = xmldate
					+ "<styles><definition><style name='CanvasAnim' type='animation' param='_xScale' start='0' duration='1' />"
					+ "</definition><application><apply toObject='Canvas' styles='CanvasAnim' /></application></styles></chart>";
			tabledata = tabledata + "</table>";
			System.out.println("tabledata=" + tabledata);
			System.out.println("xmldate=" + xmldate);

		} else if ((f1.endsWith("") && f2.equals("") && f3.equals("ok"))) {
			System.out.println("ѡ���˵�һ������");
			String p_name = "";
			String p_tool = "";
			String max_value = "";
			String min_value = "";
			try {
				sql = "select PROPERTY_NAME from OC_PROPERTY_PLA where ID="
						+ oc_property;

				rs = databaseconn.getStmt().executeQuery(sql);
				if (rs.next()) {
					p_name = rs.getString("PROPERTY_NAME");

				}

				sql = "select TOOLS_NAME from OC_PROPERTY_TOOLS_PLA where ID="
						+ oc_tools;
				rs = databaseconn.getStmt().executeQuery(sql);
				if (rs.next()) {
					p_tool = rs.getString("TOOLS_NAME");

				}
			} catch (SQLException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
			/*if (oc_max.equals("���ֵ...")) {
				max_value = "δ��";
			} else {
				max_value = oc_max;
			}
			if (oc_min.equals("��Сֵ...")) {
				min_value = "δ��";
			} else {
				min_value = oc_min;
			}*/
			if (oc_max.equals("最大值...")) {
				max_value = "未限定";
			} else {
				max_value = oc_max;
			}
			if (oc_min.equals("最小值...")) {
				min_value = "未限定";
			} else {
				min_value = oc_min;
			}
			/*tabledata = "<table width='100%'><tr><td>**����һ���ԡ�����վ�㡿������ ��������= "
					+ p_name
					+ " ���Թ���="
					+ p_tool
					+ "ȡֵ��Χ="
					+ min_value
					+ " �� " + max_value + "��ѯ**</td></tr>";

			xmldate = "<chart exportEnabled='1' exportAtClient='1' exportHandler='fcExporter1' caption='**����һ���ԡ�����վ�㡿��������������="
					+ p_name
					+ " ���Թ���="
					+ p_tool
					+ "ȡֵ��Χ="
					+ min_value
					+ " ��  "
					+ max_value
					+ "��ѯ**' xAxisName='层深'"
					+ " yAxisName='值' showValues='0' numberPrefix='value'>";*/
		tabledata = "<table width='100%'><tr><td>**查询方式为：多站点,多层深,单一属性。属性名称= "
				+ p_name
				+ "属性名称="
				+ p_tool
				+ " 取值区间为 最小值="
				+ min_value
				+ "最大值=" + max_value + "**</td></tr>";

		xmldate = "<chart exportEnabled='1' exportAtClient='1' exportHandler='fcExporter1' caption='**查询方式为：多站点,多层深,单一属性。属性名称="
				+ p_name
				+ "属性工具="
				+ p_tool
				+ " 查询最小值="
				+ min_value
				+ " 查询最大值"
				+ max_value
				+ "**' xAxisName='站点名称'"
				+ " yAxisName='属性名称' showValues='0' numberPrefix='value'>";
			
			

			sql = "select * from OC_STATION_PLA where DEL='OFF' AND ID IN ("
					+ oc_station + ")";

			try {
				rs = databaseconn.getStmt().executeQuery(sql);
				xmldate = xmldate + "<categories>";
				tabledata = tabledata + "<tr>" + "<td>" + "属性/站点" + "</td>";// �����ı��ı?
				while (rs.next()) {
					xmldate = xmldate + "<category label='"
							+ rs.getString("STATION_NAME") + "' />";
					tabledata = tabledata + "<td>"
							+ rs.getString("STATION_NAME") + "</td>";
				}
				xmldate = xmldate + "</categories>";
				tabledata = tabledata + "</tr>";
			} catch (SQLException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}

			System.out
					.println("������,����,������Сֵ��ϳ���Ӧ�ļ��ϣ����վ������Ӧ�Ĳ�ѯ");
			List<EnitityBeanOc_Date_Pla> data = new ArrayList<EnitityBeanOc_Date_Pla>();
			List<EntityBeanOc_Depthlist_Pla> p_list = new ArrayList<EntityBeanOc_Depthlist_Pla>();// ��ȵ��嵥
			List<String> sql_list = new ArrayList<String>();
			String depth[] = oc_depthlist.split(",");

			System.out.println("depth ����" + depth.length);// �������ΪY������
			for (int i = 0; i < depth.length; i++) {
				EntityBeanOc_Depthlist_Pla p = new EntityBeanOc_Depthlist_Pla();
				p.setId(Integer.valueOf(depth[i]));
				p_list.add(p);
			}
			System.out.println("p_list.size()=" + p_list.size());

			for (int j = 0; j < p_list.size(); j++) {
				System.out.println(p_list.get(j).getId());
				System.out.println("��ʼƴ����Ӧ��SQL���");
				sql = "select * " + " from OC_DATE_PLA WHERE DEL='OFF' "
						+ "AND OC_VOYAGE_ID=" + oc_voyage
						+ " AND OC_STATION_ID IN (" + oc_station + ")"
						+ "AND OC_DEPLIST_ID IN(" + p_list.get(j).getId()
						+ ") " + "AND OC_PROPERTY_ID=" + oc_property
						+ " AND OC_PROPERTY_TOOLS_ID=" + oc_tools;
				// AND VALUE_KEY >= "+p_list.get(j).getMin()+" AND VALUE_KEY
				// <="+p_list.get(j).getMax()+"
				/*if (!oc_min.equals("��Сֵ...")) {
					sql = sql + " AND VALUE_KEY >= " + oc_min;
				}
				if (!oc_max.equals("���ֵ...")) {
					sql = sql + " AND VALUE_KEY <= " + oc_max;
				}*/
				if (!oc_min.equals("最小值...")) {
					sql = sql + " AND VALUE_KEY >= " + oc_min;
				}
				if (!oc_max.equals("最大值...")) {
					sql = sql + " AND VALUE_KEY <= " + oc_max;
				}
				
				
				sql = sql + " ORDER BY OC_DEPLIST_ID";
				System.out.println("sql=" + sql);
				sql_list.add(sql);
			}

			System.out.println("ִ����ݿ����....");
			for (int i = 0; i < sql_list.size(); i++) {
				try {
					rs = databaseconn.getStmt().executeQuery(sql_list.get(i));
					System.out.println("���ִ�гɹ�");
					while (rs.next()) {// ��ȡ��ݿ���ݵ��������Ա㴦�?
						EnitityBeanOc_Date_Pla e = new EnitityBeanOc_Date_Pla();
						e.setDel(rs.getString("DEL"));
						e.setId(rs.getInt("ID"));
						e.setOc_deplist_id(rs.getInt("OC_DEPLIST_ID"));
						e.setOc_property_id(rs.getInt("OC_PROPERTY_ID"));
						e.setOc_property_tools_id(rs
								.getInt("OC_PROPERTY_TOOLS_ID"));
						e.setOc_station_id(rs.getInt("OC_STATION_ID"));
						e.setOc_voyage_id(rs.getInt("OC_VOYAGE_ID"));
						e.setValue_key(rs.getDouble("VALUE_KEY"));
						data.add(e);// ��ͬ�ֵĲ��������Ϊ��ݵĲ������Ե��� data
									// �ĳ��ȺͲ���ĳ��Ȳ����
					}
					System.out.println("��ݼ��ϵĴ�С=" + data.size());
					System.out.println("��ʼƴ����Ӧ�� XML���....");
					if (data.size() > 0) {
						sql = "select depth from OC_DEPTHLIST_PLA where ID="
								+ data.get(0).getOc_deplist_id();
						System.out.println("��ѯ�������sql" + sql);
						rs = databaseconn.getStmt().executeQuery(sql);
						String depth_name = "";

						if (rs.next()) {
							depth_name = rs.getString("depth");

						}
						xmldate = xmldate + "<dataset seriesName='"
								+ depth_name + "(" + "(M)" + ")'> ";
						tabledata = tabledata + "<tr><td>" + depth_name + "("
								+ "(M)" + ")</td>";

					} else {
						tabledata = tabledata + "<tr><td>" + "null" + "("
								+ "null" + ")</td>";
					}
					String d[] = oc_station.split(",");// ת��ʽ���ַ�����
					List<Integer> dep_list = new ArrayList();
					for (int k = 0; k < d.length; k++)// �Բ�������Ϊ��־������ѯ������
					{
						System.out
								.println("��ʾ��ѯ��¼�в��������ֵ"
										+ d[k]
										+ ",ѭ�������ݽ���е�ֵ��������������Ч��� ��û�з�������ӿ���ֵ");
						String AddEmpty = "yes";
						String value = "";
						for (int j = 0; j < data.size(); j++) {
							if (data.get(j).getOc_station_id().toString()
									.equals(d[k])) {
								value = data.get(j).getValue_key().toString();
								AddEmpty = "not";
								break;
							}
						}
						if (AddEmpty.endsWith("yes")) {

							xmldate = xmldate + "<set value='" + "'/>";
							tabledata = tabledata + "<td>" + "null" + "</td>";

						} else {

							xmldate = xmldate + "<set value='" + value + "'/>";
							tabledata = tabledata + "<td>" + value + "</td>";

						}

					}

					/*
					 * for (int j = 0; j < data.size(); j++)//�˴�Ϊ�ж�һ�� {
					 * 
					 * //��Ҫ�������ж� ����ֵ �� �����ƥ��̶� �Ӷ���뵽���λ��
					 * System.out.println("��ʾ��ѯ��¼�в��������ֵ"
					 * +data.get(j).getOc_deplist_id()); xmldate = xmldate +
					 * "<set value='" + data.get(j).getValue_key() + "'/>";
					 * tabledata
					 * =tabledata+"<td>"+data.get(j).getValue_key()+"</td>"; }
					 */
					if (data.size() > 0) {
						xmldate = xmldate + "</dataset>";
						tabledata = tabledata + "</tr>";
						data.clear();
					}

				} catch (SQLException e) {
					// TODO Auto-generated catch block
					e.printStackTrace();
				}
			}

			xmldate = xmldate
					+ "<styles><definition><style name='CanvasAnim' type='animation' param='_xScale' start='0' duration='1' />"
					+ "</definition><application><apply toObject='Canvas' styles='CanvasAnim' /></application></styles></chart>";
			tabledata = tabledata + "</table>";
			System.out.println("tabledata=" + tabledata);
			System.out.println("xmldate=" + xmldate);

		} else {
			System.out.println("��֪��ѡ��ʲô");
		}

		databaseconn = null;// �ر���ݿ�����
		request.setAttribute("tabledata", tabledata);// �׳��������
		request.setAttribute("xmldate", xmldate);
		return mapping.findForward("success");
	}
	public ActionForward function3(ActionMapping mapping, ActionForm form,
			HttpServletRequest request, HttpServletResponse response) {
		Read_Properties Read_Properties = new Read_Properties(
				"db_cn.properties");
		String ip = Read_Properties.Read_Properties_root("ip");
		String port = Read_Properties.Read_Properties_root("port");
		String service = Read_Properties.Read_Properties_root("servicname");
		String username = Read_Properties.Read_Properties_root("username");
		String password = Read_Properties.Read_Properties_root("password");
		DataBaseConn databaseconn = new DataBaseConn(ip, port, service,
				username, password);

		DynaActionForm function_searchform1 = (DynaActionForm) form;
		String sql = "";
		ResultSet rs = null;
		String oc_tools = function_searchform1.getString("H_oc_tools");
		String oc_max = function_searchform1.getString("H_oc_max");
		String oc_min = function_searchform1.getString("H_oc_min");
		String oc_voyage = function_searchform1.getString("H_oc_voyage");
		String oc_property = function_searchform1.getString("H_oc_property");
		String oc_station = function_searchform1.getString("H_oc_station");
		String oc_depthlist = function_searchform1.getString("H_oc_depthlist");
		String f1 = function_searchform1.getString("f1");
		String f2 = function_searchform1.getString("f2");
		String f3 = function_searchform1.getString("f3");
		String xmldate = "";// ��ͼ���
		String tabledata = "";// ������ ��ά����

		oc_voyage = cut_tail(oc_voyage);
		oc_property = cut_tail(oc_property);
		oc_station = cut_tail(oc_station);
		oc_depthlist = cut_tail(oc_depthlist);

		if (f1.endsWith("ok") && f2.equals("") && f3.equals("")) {
			System.out.println("单一站点多层深多属性");
			tabledata = "<table width='100%'><tr><td>**单一站点多层深多属性**</td></tr>";

			xmldate = "<chart exportEnabled='1' exportAtClient='1' exportHandler='fcExporter1' caption='**单一站点多层深多属性**' xAxisName='层深'"
					+ " yAxisName='属性值' showValues='0' numberPrefix='value'>";
			sql = "select depth from OC_DEPTHLIST_ICE where id in (" + oc_depthlist
					+ ") and del='OFF' order by depth";
			try {
				rs = databaseconn.getStmt().executeQuery(sql);
				xmldate = xmldate + "<categories>";
				tabledata = tabledata + "<tr>" + "<td>" + "层深/属性" + "</td>";// �����ı��ı?
				while (rs.next()) {
					xmldate = xmldate + "<category label='"
							+ rs.getString("depth") + "(M)' />";
					tabledata = tabledata + "<td>" + rs.getString("depth")
							+ "(M)" + "</td>";
				}
				xmldate = xmldate + "</categories>";
				tabledata = tabledata + "</tr>";
			} catch (SQLException e1) {

				e1.printStackTrace();
			}
			List<EnitityBeanOc_Date_Ice> data = new ArrayList<EnitityBeanOc_Date_Ice>();
			List<Property_Tools_Max_Min> p_list = new ArrayList<Property_Tools_Max_Min>();
			List<String> sql_list = new ArrayList<String>();
			String property[] = oc_property.split(",");
			String tools[] = oc_tools.split(",");
			String max[] = oc_max.split(",");
			String min[] = oc_min.split(",");
			System.out.println("property ����" + property.length + "tools ����"
					+ tools.length + "max ����" + max.length + "min ����"
					+ min.length);
			for (int i = 0; i < tools.length; i++) {
				Property_Tools_Max_Min p = new Property_Tools_Max_Min();
				p.setMax(max[i]);
				p.setMin(min[i]);
				p.setProperty_id(property[i]);
				p.setTools_id(tools[i]);
				p_list.add(p);
			}
			for (int j = 0; j < p_list.size(); j++) {
				System.out.println(p_list.get(j).getMax() + "  "
						+ p_list.get(j).getMin() + "  "
						+ p_list.get(j).getProperty_id() + "  "
						+ p_list.get(j).getTools_id());
				sql = "select * " + " from OC_DATE_ICE WHERE DEL='OFF' "
						+ "AND OC_VOYAGE_ID=" + oc_voyage
						+ " AND OC_STATION_ID IN (" + oc_station + ")"
						+ "AND OC_DEPLIST_ID IN(" + oc_depthlist + ") "
						+ "AND OC_PROPERTY_ID="
						+ p_list.get(j).getProperty_id()
						+ " AND OC_PROPERTY_TOOLS_ID="
						+ p_list.get(j).getTools_id();
				// AND VALUE_KEY >= "+p_list.get(j).getMin()+" AND VALUE_KEY
				// <="+p_list.get(j).getMax()+"
				if (!p_list.get(j).getMin().equals("最小值...")) {
					sql = sql + " AND VALUE_KEY >= " + p_list.get(j).getMin();
				}
				if (!p_list.get(j).getMax().equals("最大值...")) {
					sql = sql + " AND VALUE_KEY <= " + p_list.get(j).getMax();
				}
				sql = sql + " ORDER BY OC_DEPLIST_ID";
				System.out.println("sql=" + sql);
				sql_list.add(sql);
			}
			System.out.println("开始执行SQL的计划");
			for (int i = 0; i < sql_list.size(); i++) {
				try {
					rs = databaseconn.getStmt().executeQuery(sql_list.get(i));
					System.out.println("Sql=" + sql_list.get(i) + "执行完毕");
					while (rs.next()) {
						EnitityBeanOc_Date_Ice e = new EnitityBeanOc_Date_Ice();
						e.setDel(rs.getString("DEL"));
						e.setId(rs.getInt("ID"));
						e.setOc_deplist_id(rs.getInt("OC_DEPLIST_ID"));
						e.setOc_property_id(rs.getInt("OC_PROPERTY_ID"));
						e.setOc_property_tools_id(rs
								.getInt("OC_PROPERTY_TOOLS_ID"));
						e.setOc_station_id(rs.getInt("OC_STATION_ID"));
						e.setOc_voyage_id(rs.getInt("OC_VOYAGE_ID"));
						e.setValue_key(rs.getDouble("VALUE_KEY"));
						data.add(e);
					}
					System.out.println("完成数据的" + data.size());
					if (data.size() > 0) {
						sql = "select PROPERTY_NAME from OC_PROPERTY_ICE where ID="
								+ data.get(0).getOc_property_id();
						rs = databaseconn.getStmt().executeQuery(sql);
						String property_name = "";
						String property_tools = "";
						if (rs.next()) {
							property_name = rs.getString("PROPERTY_NAME");

						}
						sql = "select TOOLS_NAME from OC_PROPERTY_TOOLS_ICE where ID="
								+ data.get(0).getOc_property_tools_id();
						rs = databaseconn.getStmt().executeQuery(sql);
						if (rs.next()) {
							property_tools = rs.getString("TOOLS_NAME");

						}
						xmldate = xmldate + "<dataset seriesName='"
								+ property_name + "(" + property_tools + ")'> ";
						tabledata = tabledata + "<tr><td>" + property_name
								+ "(" + property_tools + ")</td>";

					} else {
						xmldate = xmldate + "<dataset seriesName='" + "位置的属性"
								+ "(" + "位置的工具" + ")'> ";
						tabledata = tabledata + "<tr><td>" + "null" + "("
								+ "null" + ")</td>";
					}
					String d[] = oc_depthlist.split(",");// ת��ʽ���ַ�����
					List<Integer> dep_list = new ArrayList();
					for (int k = 0; k < d.length; k++)// �Բ�������Ϊ��־������ѯ������
					{
						System.out.println("由于数据没有加入一个空值" + d[k] + ",数据的内容");
						String AddEmpty = "yes";
						String value = "";
						for (int j = 0; j < data.size(); j++) {
							if (data.get(j).getOc_deplist_id().toString()
									.equals(d[k])) {
								value = data.get(j).getValue_key().toString();
								AddEmpty = "not";
								break;
							}
						}
						if (AddEmpty.endsWith("yes")) {

							xmldate = xmldate + "<set value='" + "'/>";
							tabledata = tabledata + "<td>" + "null" + "</td>";

						} else {

							xmldate = xmldate + "<set value='" + value + "'/>";
							tabledata = tabledata + "<td>" + value + "</td>";

						}

					}

					if (data.size() >= 0) {
						xmldate = xmldate + "</dataset>";
						tabledata = tabledata + "</tr>";
						System.out.println("添加一个尾部数据是的数据完整");
						data.clear();
					}

				} catch (SQLException e) {
					// TODO Auto-generated catch block
					e.printStackTrace();
				}
			}

			xmldate = xmldate
					+ "<styles><definition><style name='CanvasAnim' type='animation' param='_xScale' start='0' duration='1' />"
					+ "</definition><application><apply toObject='Canvas' styles='CanvasAnim' /></application></styles></chart>";
			tabledata = tabledata + "</table>";
			System.out.println("tabledata=" + tabledata);
			System.out.println("xmldate=" + xmldate);

		} else if (f1.endsWith("") && f2.equals("ok") && f3.equals("")) {
			String dp = "";
			sql = "select * from oc_depthlist_ice where DEL='OFF' AND ID="
					+ oc_depthlist;
			try {
				rs = databaseconn.getStmt().executeQuery(sql);

				while (rs.next()) {
					dp = rs.getString("depth");
				}
				tabledata = "<table width='100%'><tr><td>**�=" + dp
						+ "(M) ��ѯ**</td></tr>";
				xmldate = "<chart exportEnabled='1' exportAtClient='1' exportHandler='fcExporter1' caption='**����һ��ȡ����������ԡ�����վ�㡿���="
						+ dp
						+ "(M) ��ѯ**' xAxisName='层深'"
						+ " yAxisName='值' showValues='0' numberPrefix='value'>";
				sql = "select * from OC_STATION_ICE where DEL='OFF' AND ID IN ("
						+ oc_station + ")";

				rs = databaseconn.getStmt().executeQuery(sql);
				xmldate = xmldate + "<categories>";
				tabledata = tabledata + "<tr>" + "<td>" + "属性/站点" + "</td>";// �����ı��ı?
				while (rs.next()) {
					xmldate = xmldate + "<category label='"
							+ rs.getString("STATION_NAME") + "' />";
					tabledata = tabledata + "<td>"
							+ rs.getString("STATION_NAME") + "</td>";
				}
				xmldate = xmldate + "</categories>";
				tabledata = tabledata + "</tr>";
			} catch (SQLException e1) {

				e1.printStackTrace();
			}
			List<EnitityBeanOc_Date_Ice> data = new ArrayList<EnitityBeanOc_Date_Ice>();
			List<Property_Tools_Max_Min> p_list = new ArrayList<Property_Tools_Max_Min>();
			List<String> sql_list = new ArrayList<String>();
			String property[] = oc_property.split(",");
			String tools[] = oc_tools.split(",");
			String max[] = oc_max.split(",");
			String min[] = oc_min.split(",");
			for (int i = 0; i < tools.length; i++) {
				Property_Tools_Max_Min p = new Property_Tools_Max_Min();
				p.setMax(max[i]);
				p.setMin(min[i]);
				p.setProperty_id(property[i]);
				p.setTools_id(tools[i]);
				p_list.add(p);
			}
			for (int j = 0; j < p_list.size(); j++) {
				sql = "select * " + " from OC_DATE_ICE WHERE DEL='OFF' "
						+ "AND OC_VOYAGE_ID=" + oc_voyage
						+ " AND OC_STATION_ID IN (" + oc_station + ")"
						+ "AND OC_DEPLIST_ID IN(" + oc_depthlist + ") "
						+ "AND OC_PROPERTY_ID="
						+ p_list.get(j).getProperty_id()
						+ " AND OC_PROPERTY_TOOLS_ID="
						+ p_list.get(j).getTools_id();
				if (!p_list.get(j).getMin().equals("最小值...")) {
					sql = sql + " AND VALUE_KEY >= " + p_list.get(j).getMin();
				}
				if (!p_list.get(j).getMax().equals("最大值...")) {
					sql = sql + " AND VALUE_KEY <= " + p_list.get(j).getMax();
				}
				sql = sql + " ORDER BY OC_STATION_ID";
				System.out.println("sql=" + sql);
				sql_list.add(sql);
			}

			System.out.println("ִ����ݿ����....");
			for (int i = 0; i < sql_list.size(); i++) {
				try {
					rs = databaseconn.getStmt().executeQuery(sql_list.get(i));
					System.out.println("���ִ�гɹ�");
					while (rs.next()) {// ��ȡ��ݿ���ݵ��������Ա㴦�?
						EnitityBeanOc_Date_Ice e = new EnitityBeanOc_Date_Ice();
						e.setDel(rs.getString("DEL"));
						e.setId(rs.getInt("ID"));
						e.setOc_deplist_id(rs.getInt("OC_DEPLIST_ID"));
						e.setOc_property_id(rs.getInt("OC_PROPERTY_ID"));
						e.setOc_property_tools_id(rs
								.getInt("OC_PROPERTY_TOOLS_ID"));
						e.setOc_station_id(rs.getInt("OC_STATION_ID"));
						e.setOc_voyage_id(rs.getInt("OC_VOYAGE_ID"));
						e.setValue_key(rs.getDouble("VALUE_KEY"));
						data.add(e);// ��ͬ�ֵĲ��������Ϊ��ݵĲ������Ե��� data
									// �ĳ��ȺͲ���ĳ��Ȳ����
					}
					System.out.println("��ݼ��ϵĴ�С=" + data.size());
					System.out.println("��ʼƴ����Ӧ�� XML���....");
					if (data.size() > 0) {
						sql = "select PROPERTY_NAME from OC_PROPERTY_ICE where ID="
								+ data.get(0).getOc_property_id();
						System.out.println("��ѯ�������sql" + sql);
						rs = databaseconn.getStmt().executeQuery(sql);
						String property_name = "";
						String property_tools = "";
						if (rs.next()) {
							property_name = rs.getString("PROPERTY_NAME");

						}
						sql = "select TOOLS_NAME from OC_PROPERTY_TOOLS_ICE where ID="
								+ data.get(0).getOc_property_tools_id();
						System.out.println("��ѯ���Թ������sql" + sql);
						rs = databaseconn.getStmt().executeQuery(sql);
						if (rs.next()) {
							property_tools = rs.getString("TOOLS_NAME");

						}
						xmldate = xmldate + "<dataset seriesName='"
								+ property_name + "(" + property_tools + ")'> ";
						tabledata = tabledata + "<tr><td>" + property_name
								+ "(" + property_tools + ")</td>";

					} else {
						tabledata = tabledata + "<tr><td>" + "null" + "("
								+ "null" + ")</td>";
					}
					String d[] = oc_station.split(",");// ת��ʽ���ַ�����
					List<Integer> dep_list = new ArrayList();
					for (int k = 0; k < d.length; k++)// �Բ�������Ϊ��־������ѯ������
					{
						String AddEmpty = "yes";
						String value = "";
						for (int j = 0; j < data.size(); j++) {
							if (data.get(j).getOc_station_id().toString()
									.equals(d[k])) {
								value = data.get(j).getValue_key().toString();
								AddEmpty = "not";
								break;
							}
						}
						if (AddEmpty.endsWith("yes")) {

							xmldate = xmldate + "<set value='" + "'/>";
							tabledata = tabledata + "<td>" + "null" + "</td>";

						} else {

							xmldate = xmldate + "<set value='" + value + "'/>";
							tabledata = tabledata + "<td>" + value + "</td>";

						}

					}

					/*
					 * for (int j = 0; j < data.size(); j++)//�˴�Ϊ�ж�һ�� {
					 * 
					 * //��Ҫ�������ж� ����ֵ �� �����ƥ��̶� �Ӷ���뵽���λ��
					 * System.out.println("��ʾ��ѯ��¼�в��������ֵ"
					 * +data.get(j).getOc_deplist_id()); xmldate = xmldate +
					 * "<set value='" + data.get(j).getValue_key() + "'/>";
					 * tabledata
					 * =tabledata+"<td>"+data.get(j).getValue_key()+"</td>"; }
					 */
					if (data.size() > 0) {
						xmldate = xmldate + "</dataset>";
						tabledata = tabledata + "</tr>";
						data.clear();
					}

				} catch (SQLException e) {
					// TODO Auto-generated catch block
					e.printStackTrace();
				}
			}

			xmldate = xmldate
					+ "<styles><definition><style name='CanvasAnim' type='animation' param='_xScale' start='0' duration='1' />"
					+ "</definition><application><apply toObject='Canvas' styles='CanvasAnim' /></application></styles></chart>";
			tabledata = tabledata + "</table>";
			System.out.println("tabledata=" + tabledata);
			System.out.println("xmldate=" + xmldate);

		} else if ((f1.endsWith("") && f2.equals("") && f3.equals("ok"))) {
			System.out.println("ѡ���˵�һ������");
			String p_name = "";
			String p_tool = "";
			String max_value = "";
			String min_value = "";
			try {
				sql = "select PROPERTY_NAME from OC_PROPERTY_ICE where ID="
						+ oc_property;

				rs = databaseconn.getStmt().executeQuery(sql);
				if (rs.next()) {
					p_name = rs.getString("PROPERTY_NAME");

				}

				sql = "select TOOLS_NAME from OC_PROPERTY_TOOLS_ICE where ID="
						+ oc_tools;
				rs = databaseconn.getStmt().executeQuery(sql);
				if (rs.next()) {
					p_tool = rs.getString("TOOLS_NAME");

				}
			} catch (SQLException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
			/*if (oc_max.equals("���ֵ...")) {
				max_value = "δ��";
			} else {
				max_value = oc_max;
			}
			if (oc_min.equals("��Сֵ...")) {
				min_value = "δ��";
			} else {
				min_value = oc_min;
			}*/
			if (oc_max.equals("最大值...")) {
				max_value = "未限定";
			} else {
				max_value = oc_max;
			}
			if (oc_min.equals("最小值...")) {
				min_value = "未限定";
			} else {
				min_value = oc_min;
			}	
			
			/*tabledata = "<table width='100%'><tr><td>**����һ���ԡ�����վ�㡿������ ��������= "
					+ p_name
					+ " ���Թ���="
					+ p_tool
					+ "ȡֵ��Χ="
					+ min_value
					+ " �� " + max_value + "��ѯ**</td></tr>";

			xmldate = "<chart exportEnabled='1' exportAtClient='1' exportHandler='fcExporter1' caption='**����һ���ԡ�����վ�㡿��������������="
					+ p_name
					+ " ���Թ���="
					+ p_tool
					+ "ȡֵ��Χ="
					+ min_value
					+ " ��  "
					+ max_value
					+ "��ѯ**' xAxisName='层深'"
					+ " yAxisName='����ֵ' showValues='0' numberPrefix='value'>";*/
			tabledata = "<table width='100%'><tr><td>**查询方式为：多站点,多层深,单一属性。属性名称= "
				+ p_name
				+ "属性名称="
				+ p_tool
				+ " 取值区间为 最小值="
				+ min_value
				+ "最大值=" + max_value + "**</td></tr>";

		xmldate = "<chart exportEnabled='1' exportAtClient='1' exportHandler='fcExporter1' caption='**查询方式为：多站点,多层深,单一属性。属性名称="
				+ p_name
				+ "属性工具="
				+ p_tool
				+ " 查询最小值="
				+ min_value
				+ " 查询最大值"
				+ max_value
				+ "**' xAxisName='站点名称'"
				+ " yAxisName='属性名称' showValues='0' numberPrefix='value'>";


			sql = "select * from OC_STATION_ICE where DEL='OFF' AND ID IN ("
					+ oc_station + ")";

			try {
				rs = databaseconn.getStmt().executeQuery(sql);
				xmldate = xmldate + "<categories>";
				tabledata = tabledata + "<tr>" + "<td>" + "属性/站点" + "</td>";// �����ı��ı?
				while (rs.next()) {
					xmldate = xmldate + "<category label='"
							+ rs.getString("STATION_NAME") + "' />";
					tabledata = tabledata + "<td>"
							+ rs.getString("STATION_NAME") + "</td>";
				}
				xmldate = xmldate + "</categories>";
				tabledata = tabledata + "</tr>";
			} catch (SQLException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
			List<EnitityBeanOc_Date_Ice> data = new ArrayList<EnitityBeanOc_Date_Ice>();
			List<EntityBeanOc_Depthlist_Ice> p_list = new ArrayList<EntityBeanOc_Depthlist_Ice>();// ��ȵ��嵥
			List<String> sql_list = new ArrayList<String>();
			String depth[] = oc_depthlist.split(",");

			System.out.println("depth ����" + depth.length);// �������ΪY������
			for (int i = 0; i < depth.length; i++) {
				EntityBeanOc_Depthlist_Ice p = new EntityBeanOc_Depthlist_Ice();
				p.setId(Integer.valueOf(depth[i]));
				p_list.add(p);
			}
			System.out.println("p_list.size()=" + p_list.size());

			for (int j = 0; j < p_list.size(); j++) {
				System.out.println(p_list.get(j).getId());
				System.out.println("��ʼƴ����Ӧ��SQL���");
				sql = "select * " + " from OC_DATE_ICE WHERE DEL='OFF' "
						+ "AND OC_VOYAGE_ID=" + oc_voyage
						+ " AND OC_STATION_ID IN (" + oc_station + ")"
						+ "AND OC_DEPLIST_ID IN(" + p_list.get(j).getId()
						+ ") " + "AND OC_PROPERTY_ID=" + oc_property
						+ " AND OC_PROPERTY_TOOLS_ID=" + oc_tools;
				// AND VALUE_KEY >= "+p_list.get(j).getMin()+" AND VALUE_KEY
				// <="+p_list.get(j).getMax()+"
				/*if (!oc_min.equals("��Сֵ...")) {
					sql = sql + " AND VALUE_KEY >= " + oc_min;
				}
				if (!oc_max.equals("���ֵ...")) {
					sql = sql + " AND VALUE_KEY <= " + oc_max;
				}*/
				if (!oc_min.equals("最小值...")) {
					sql = sql + " AND VALUE_KEY >= " + oc_min;
				}
				if (!oc_max.equals("最大值...")) {
					sql = sql + " AND VALUE_KEY <= " + oc_max;
				}
				sql = sql + " ORDER BY OC_DEPLIST_ID";
				System.out.println("sql=" + sql);
				sql_list.add(sql);
			}

			System.out.println("ִ����ݿ����....");
			for (int i = 0; i < sql_list.size(); i++) {
				try {
					rs = databaseconn.getStmt().executeQuery(sql_list.get(i));
					System.out.println("���ִ�гɹ�");
					while (rs.next()) {// ��ȡ��ݿ���ݵ��������Ա㴦�?
						EnitityBeanOc_Date_Ice e = new EnitityBeanOc_Date_Ice();
						e.setDel(rs.getString("DEL"));
						e.setId(rs.getInt("ID"));
						e.setOc_deplist_id(rs.getInt("OC_DEPLIST_ID"));
						e.setOc_property_id(rs.getInt("OC_PROPERTY_ID"));
						e.setOc_property_tools_id(rs
								.getInt("OC_PROPERTY_TOOLS_ID"));
						e.setOc_station_id(rs.getInt("OC_STATION_ID"));
						e.setOc_voyage_id(rs.getInt("OC_VOYAGE_ID"));
						e.setValue_key(rs.getDouble("VALUE_KEY"));
						data.add(e);// ��ͬ�ֵĲ��������Ϊ��ݵĲ������Ե��� data
									// �ĳ��ȺͲ���ĳ��Ȳ����
					}
					System.out.println("��ݼ��ϵĴ�С=" + data.size());
					System.out.println("��ʼƴ����Ӧ�� XML���....");
					if (data.size() > 0) {
						sql = "select depth from OC_DEPTHLIST_ICE where ID="
								+ data.get(0).getOc_deplist_id();
						System.out.println("��ѯ�������sql" + sql);
						rs = databaseconn.getStmt().executeQuery(sql);
						String depth_name = "";

						if (rs.next()) {
							depth_name = rs.getString("depth");

						}
						xmldate = xmldate + "<dataset seriesName='"
								+ depth_name + "(" + "(M)" + ")'> ";
						tabledata = tabledata + "<tr><td>" + depth_name + "("
								+ "(M)" + ")</td>";

					} else {
						tabledata = tabledata + "<tr><td>" + "null" + "("
								+ "null" + ")</td>";
					}
					String d[] = oc_station.split(",");// ת��ʽ���ַ�����
					List<Integer> dep_list = new ArrayList();
					for (int k = 0; k < d.length; k++)// �Բ�������Ϊ��־������ѯ������
					{
						String AddEmpty = "yes";
						String value = "";
						for (int j = 0; j < data.size(); j++) {
							if (data.get(j).getOc_station_id().toString()
									.equals(d[k])) {
								value = data.get(j).getValue_key().toString();
								AddEmpty = "not";
								break;
							}
						}
						if (AddEmpty.endsWith("yes")) {

							xmldate = xmldate + "<set value='" + "'/>";
							tabledata = tabledata + "<td>" + "null" + "</td>";

						} else {

							xmldate = xmldate + "<set value='" + value + "'/>";
							tabledata = tabledata + "<td>" + value + "</td>";

						}

					}
					if (data.size() > 0) {
						xmldate = xmldate + "</dataset>";
						tabledata = tabledata + "</tr>";
						data.clear();
					}

				} catch (SQLException e) {
					// TODO Auto-generated catch block
					e.printStackTrace();
				}
			}

			xmldate = xmldate
					+ "<styles><definition><style name='CanvasAnim' type='animation' param='_xScale' start='0' duration='1' />"
					+ "</definition><application><apply toObject='Canvas' styles='CanvasAnim' /></application></styles></chart>";
			tabledata = tabledata + "</table>";
			System.out.println("tabledata=" + tabledata);
			System.out.println("xmldate=" + xmldate);

		} else {
			System.out.println("��֪��ѡ��ʲô");
		}

		databaseconn = null;// �ر���ݿ�����
		request.setAttribute("tabledata", tabledata);// �׳��������
		request.setAttribute("xmldate", xmldate);
		return mapping.findForward("success");
	}
	private String cut_tail(String str) {
		String cut = str;
		if (str.endsWith(",")) {
			cut = cut.substring(0, cut.length() - 1);
		}
		return cut;
	}

	public ActionForward init_search(ActionMapping mapping, ActionForm form,
			HttpServletRequest request, HttpServletResponse response)
			throws Exception {
		System.out.println("尝试初始化查询页面数据~");
		System.out.println("校验用户信息");

		EntityBeanOc_User_Name e = new EntityBeanOc_User_Name();
		e = (EntityBeanOc_User_Name) request.getSession().getAttribute(
				"Ocean_User");
		if (e == null) {
			System.out.println("会话变量丢失");
			return mapping.findForward("error");
		} else {

			System.out.println("查询数据库内容初始化内容");
			Integer i = 5;
			List<EntityBeanOc_Depthlist> oc_depthlist = this.service_search
					.Find_Oc_Depthlist();
			request.setAttribute("oc_depthlist", oc_depthlist);

			List<EntityBean_Oc_Property> oc_property = this.service_search
					.Find_EntityBean_Oc_Property_by_property_kind(i);

			request.setAttribute("oc_property", oc_property);// ������Ա���ֵ
			List<View_Property_Tools> list_view_property_tools = new ArrayList<View_Property_Tools>();
			for (int j = 0; j < oc_property.size(); j++) {
				Integer k = oc_property.get(j).getId();
				List<EntityBean_Oc_Property_Tools> tools = new ArrayList<EntityBean_Oc_Property_Tools>();
				tools = this.service_search
						.Find_EntityBean_Oc_Property_Tools_by_property_id(k);
				View_Property_Tools t = new View_Property_Tools();
				t.setId(j);
				t.setList_property_tools(tools);
				list_view_property_tools.add(t);
			}
			System.out.println("list_view_property_tools"
					+ list_view_property_tools.size());

			for (int ii = 0; ii < list_view_property_tools.size(); ii++) {
				System.out.println(list_view_property_tools.get(ii)
						.getList_property_tools().size());
				for (int h = 0; h < list_view_property_tools.get(ii)
						.getList_property_tools().size(); h++) {
					System.out.println(list_view_property_tools.get(ii)
							.getList_property_tools().get(h).getTools_name());

				}
			}
			
			//载入海域的值
			List<EntityBeanOc_Sea_Area>list_sea_area=this.service_search.Find_Oc_Sea_Area_ISACTIVE();
			//载入海域的值
			request.setAttribute("list_view_property_tools",
					list_view_property_tools);
			request.setAttribute("list_sea_area",
					list_sea_area);
			
			List<EntityBeanOc_Boat> oc_boatlist = this.service_search
					.Find_Oc_Boat_By_oc_boatkind(i);
			System.out.println(oc_boatlist.size());
			request.setAttribute("oc_boatlist", oc_boatlist);
			return mapping.findForward("success");
		}
	}

	public ActionForward init_search_Pla(ActionMapping mapping, ActionForm form,
			HttpServletRequest request, HttpServletResponse response)
			throws Exception {
		System.out.println("尝试初始化查询页面数据~");
		System.out.println("校验用户信息");

		EntityBeanOc_User_Name e = new EntityBeanOc_User_Name();
		e = (EntityBeanOc_User_Name) request.getSession().getAttribute(
				"Ocean_User");
		if (e == null) {
			System.out.println("会话变量丢失");
			return mapping.findForward("error");
		} else {

			System.out.println("查询数据库内容初始化内容");
			Integer i = 7;
			List<EntityBeanOc_Depthlist_Pla> oc_depthlist_pla = this.service_search
					.Find_Oc_Depthlist_Pla();
			request.setAttribute("oc_depthlist_pla", oc_depthlist_pla);

			List<EntityBean_Oc_Property_Pla> oc_property_pla = this.service_search
					.Find_EntityBean_Oc_Property_Pla_by_property_kind(i);

			request.setAttribute("oc_property_pla", oc_property_pla);// ������Ա���ֵ
			List<View_Property_Tools_Pla> list_view_property_tools_pla = new ArrayList<View_Property_Tools_Pla>();
			for (int j = 0; j < oc_property_pla.size(); j++) {
				Integer k = oc_property_pla.get(j).getId();
				List<EntityBean_Oc_Property_Tools_Pla> tools = new ArrayList<EntityBean_Oc_Property_Tools_Pla>();
				tools = this.service_search
						.Find_EntityBean_Oc_Property_Tools_Pla_by_property_id(k);
				View_Property_Tools_Pla t = new View_Property_Tools_Pla();
				t.setId(j);
				t.setList_property_tools(tools);
				list_view_property_tools_pla.add(t);
			}
			System.out.println("list_view_property_tools_pla"
					+ list_view_property_tools_pla.size());

			for (int ii = 0; ii < list_view_property_tools_pla.size(); ii++) {
				System.out.println(list_view_property_tools_pla.get(ii)
						.getList_property_tools().size());
				for (int h = 0; h < list_view_property_tools_pla.get(ii)
						.getList_property_tools().size(); h++) {
					System.out.println(list_view_property_tools_pla.get(ii)
							.getList_property_tools().get(h).getTools_name());

				}
			}
			//载入海域的值
			List<EntityBeanOc_Sea_Area_Pla>list_sea_area=this.service_search.Find_Oc_Sea_Area_Pla_ISACTIVE();
			//载入海域的值
			request.setAttribute("list_sea_area",
					list_sea_area);
			request.setAttribute("list_view_property_tools_pla",
					list_view_property_tools_pla);
			
			List<EntityBeanOc_Boat_Pla> oc_boatlist_pla = this.service_search
					.Find_Oc_Boat_Pla_By_oc_boatkind(i);
			System.out.println(oc_boatlist_pla.size());
			request.setAttribute("oc_boatlist_pla", oc_boatlist_pla);
			return mapping.findForward("success");
		}
	}
	
	public ActionForward init_search_Ben(ActionMapping mapping, ActionForm form,
			HttpServletRequest request, HttpServletResponse response)
			throws Exception {
		System.out.println("尝试初始化查询页面数据~");
		System.out.println("校验用户信息");

		EntityBeanOc_User_Name e = new EntityBeanOc_User_Name();
		e = (EntityBeanOc_User_Name) request.getSession().getAttribute(
				"Ocean_User");
		if (e == null) {
			System.out.println("会话变量丢失");
			return mapping.findForward("error");
		} else {

			System.out.println("查询数据库内容初始化内容");

			Integer i = 8;
			List<EntityBeanOc_Depthlist_Ben> oc_depthlist_ben = this.service_search
					.Find_Oc_Depthlist_Ben();
			request.setAttribute("oc_depthlist_ben", oc_depthlist_ben);


			List<EntityBean_Oc_Property_Ben> oc_property_ben = this.service_search
					.Find_EntityBean_Oc_Property_ben_by_property_kind(i);

			request.setAttribute("oc_property_ben", oc_property_ben);// ������Ա���ֵ
			List<View_Property_Tools_Ben> list_view_property_tools_ben = new ArrayList<View_Property_Tools_Ben>();
			for (int j = 0; j < oc_property_ben.size(); j++) {
				Integer k = oc_property_ben.get(j).getId();
				List<EntityBean_Oc_Property_Tools_Ben> tools = new ArrayList<EntityBean_Oc_Property_Tools_Ben>();
				tools = this.service_search
						.Find_EntityBean_Oc_Property_Tools_Ben_by_property_id(k);
				View_Property_Tools_Ben t = new View_Property_Tools_Ben();
				t.setId(j);
				t.setList_property_tools(tools);
				list_view_property_tools_ben.add(t);
			}
			System.out.println("list_view_property_tools"
					+ list_view_property_tools_ben.size());

			for (int ii = 0; ii < list_view_property_tools_ben.size(); ii++) {
				System.out.println(list_view_property_tools_ben.get(ii)
						.getList_property_tools().size());
				for (int h = 0; h < list_view_property_tools_ben.get(ii)
						.getList_property_tools().size(); h++) {
					System.out.println(list_view_property_tools_ben.get(ii)
							.getList_property_tools().get(h).getTools_name());

				}
			}
			//载入海域的值
			List<EntityBeanOc_Sea_Area_Ben>list_sea_area=this.service_search.Find_Oc_Sea_Area_Ben_ISACTIVE();
			//载入海域的值
			request.setAttribute("list_sea_area",
					list_sea_area);
			request.setAttribute("list_view_property_tools_ben",
					list_view_property_tools_ben);
			List<EntityBeanOc_Boat_Ben> oc_boatlist_ben = this.service_search
					.Find_Oc_Boat_Ben_By_oc_boatkind(i);
			System.out.println(oc_boatlist_ben.size());
			request.setAttribute("oc_boatlist_ben", oc_boatlist_ben);
			return mapping.findForward("success");
		}
	}
	public ActionForward init_search_Ice(ActionMapping mapping,
			ActionForm form, HttpServletRequest request,
			HttpServletResponse response) throws Exception {
		System.out.println("尝试初始化查询页面数据~");
		System.out.println("校验用户信息");

		EntityBeanOc_User_Name e = new EntityBeanOc_User_Name();
		e = (EntityBeanOc_User_Name) request.getSession().getAttribute(
				"Ocean_User");
		if (e == null) {
			System.out.println("会话变量丢失");
			return mapping.findForward("error");
		} else {

			System.out.println("查询数据库内容初始化内容");
			Integer i = 6;
			List<EntityBeanOc_Depthlist_Ice> oc_depthlist = this.service_search
					.Find_EntityBeanOc_Depthlist_Ice();
			request.setAttribute("oc_depthlist", oc_depthlist);

			List<EntityBean_Oc_Property_Ice> oc_property = this.service_search
					.Find_EntityBean_Oc_Property_Ice_by_property_kind(6);

			request.setAttribute("oc_property", oc_property);// ������Ա���ֵ
			List<View_Property_Tools_Ice> list_view_property_tools = new ArrayList<View_Property_Tools_Ice>();
			for (int j = 0; j < oc_property.size(); j++) {
				Integer k = oc_property.get(j).getId();
				List<EntityBean_Oc_Property_Tools_Ice> tools = new ArrayList<EntityBean_Oc_Property_Tools_Ice>();
				tools = this.service_search
						.Find_EntityBean_Oc_Property_Tools_Ice_by_property_id(k);
				View_Property_Tools_Ice t = new View_Property_Tools_Ice();
				t.setId(j);
				t.setList_property_tools(tools);
				list_view_property_tools.add(t);
			}
			System.out.println("list_view_property_tools"
					+ list_view_property_tools.size());

			for (int ii = 0; ii < list_view_property_tools.size(); ii++) {
				System.out.println(list_view_property_tools.get(ii)
						.getList_property_tools().size());
				for (int h = 0; h < list_view_property_tools.get(ii)
						.getList_property_tools().size(); h++) {
					System.out.println(list_view_property_tools.get(ii)
							.getList_property_tools().get(h).getTools_name());

				}
			}
			//载入海域的值
			List<EntityBeanOc_Sea_Area_Ice>list_sea_area=this.service_search.Find_EntityBeanOc_Sea_Area_Ice();
			//载入海域的值
			request.setAttribute("list_sea_area",
					list_sea_area);
			request.setAttribute("list_view_property_tools",
					list_view_property_tools);
			List<EntityBeanOc_Boat_Ice> oc_boatlist = this.service_search
					.Find_Oc_Boat_Ice_By_oc_boatkind(i);
			System.out.println(oc_boatlist.size());
			request.setAttribute("oc_boatlist", oc_boatlist);
			return mapping.findForward("success");
		}
	}

	
}
